More importantly, the error also doesn't occur with
S = Curve(f).riemann_surface(integration_method="heuristic")
so it's indeed in the newer code. The fact that swapping x,z makes the error disappear is also unsurprising: entirely different path integrals are executed.
As an indication for what is likely happening, on line 2211:
delta_z and rho_z seem to be indistinguishable, forcing Delta and M to be +infinity. Path splitting should definitely happen here. I think delta_z should have been smaller than rho_z when you reach this point, so I think the code should have bailed before.