The camera frame (used for selection) was drawn outside the near
clipping plane in those cases.
This has been an issue before as seen in the following commits:
Remaining issue was that the code which ensure the frame isn't behind
the near clipping plane was not taking into account the camera could be
scaled (in Z).
A caller of BKE_camera_view_frame_ex (namely
OVERLAY_camera_cache_populate) applies scale (also on the depth) which
does not play well with the way BKE_camera_view_frame_ex did it.
Now take Z scale into account.