As explained in this post which I only found after a lot of confusion, the camera ViewportSize remains 1x1 pixels when used in a viewport frame. Methods like ViewportPointToRay require x and y in terms of pixels but if this is called on a viewport frame camera then you actually want to provide x and y in terms of Scale (0-1). It may be a good idea to clarify this in the camera documentation.
Page URL: https://create.roblox.com/docs/reference/engine/classes/Camera#functions