Yes as I thought it was the the viewport transformation to NDC (normalized device coordinate ) coordinates:

Code changed to this fixed it.
ray_start[0] = (x / viewer.view.viewport.width()) * 2 - 1;
ray_start[1] = -(y / viewer.view.viewport.height()) * 2 + 1;
ray_start[2] = 1;
ray_dest[0] = (x / viewer.view.viewport.width()) * 2 - 1;
ray_dest[1] = -(y / viewer.view.viewport.height()) * 2 + 1;
ray_dest[2] = 0;
Cheers,
Wilson

Find content
Not Telling