You get null because you’ve caused a warning. If I adjust my view so it no longer fits on the page (say be setting the scale to 1:2) I get the same result.
The work around is to ensure that your view’s viewport (called this instead of view crop because it’s on a sheet now so it is shrunk by the scale) is smaller than the title block in the X and Y direction, and toss a warning informing of such. Looks something like this (though I lack the time to debug it for you)
If the view’s viewport is even slightly bigger than the sheet’s titleblock, the algorithm doing the view packing will fail. There’s a few great alternatives on the forum, the first that comes to mind is this one: