Numerical contour integrations in the complex plane - contour deformation gives different answer for analytic kernel

(This is more of a plausibility argument than a rigorous answer.)

I had previously mentioned that one would want to avoid contours that go too near to the imaginary axis, since the resulting integrals will tend to be ill-conditioned. If my words were not sufficiently convincing, then maybe a few pictures might help you see what I'm seeing:

With[{m = 3, z = 1}, 
     Table[Plot3D[With[{β = u + I v}, f[Exp[I m β + I z Cos[β]]]],
                  {u, -π, π}, {v, -6, 6},
                  BoundaryStyle -> None, BoxRatios -> {1, 3/2, 3/2}, ClippingStyle -> None,
                  Mesh -> False, PlotLabel -> f, PlotRange -> {-10, 10},
                  PlotStyle -> Directive[Pink, Specularity[White, 50], Opacity[0.8]]],
           {f, {Re, Im}}] // GraphicsRow]

integrand for Hankel function contour integral

The pictures given above are plots of the real and imaginary parts of $\exp(i m \beta + i z \cos\beta)$ for $m=3$ and $z=1$, within the region $-\pi < \Re \beta < \pi$. As you might notice, the integrand varies rather wildly on the imaginary axis; it stands to reason that a contour that lies too near to it will give function values that vary wildly as well, making numerical computations of the contour integral unstable. You'll thus want a contour that tries to keep away from the "forest". In particular, contours that lie on $\Re \beta=-\pi/2$ for $\Im \beta > 0$ and $\Re \beta=\pi/2$ for $\Im \beta < 0$ are at a comfortable distance from the "forest", which makes them suitable for quadrature.