The problem was that the v3d could have a different camera to the scene even when locked. VIEW3D_OT_viewnumpad was ignoring v3d->scenelock option and allowing an invalid state.
The problem was that the v3d could have a different camera to the scene even when locked. VIEW3D_OT_viewnumpad was ignoring v3d->scenelock option and allowing an invalid state.