PhysX errors using AddCustomPhysics with substepping disabled

I think there may be an issue with this function for registering custom physics in FPhysScene. It’s executed under a PhysX read lock, but if substepping is not enabled on the scene, it just synchronously calls the custom physics callback right away. If the callback attempts to do anything such as adding forces, a write lock will then be requested which is apparently unsupported. The log is spammed with:

eINVALID_OPERATION : PxScene::lockWrite() detected after a PxScene::lockRead(), lock upgrading is not supported, behaviour will be undefined.

If substepping is enabled on the scene, then everything behaves as expected.

My assumption is the callback is made with the intention that physics code can be written to work independently of whether substepping is enabled or not, which makes sense. However, it seems like this, even without the lock issue, would result in physics code being executed at a different stage depending on the substepping settings. If AddCustomPhysics is called in a TG_PrePhysics tick, then with substepping off the code would also be executed pre-physics, whereas presumably with substepping on, it would be executed in TG_DuringPhysics.