Panda PhysX

I’m having trouble when removing a PhysActor with its remove() function. I get the following assertion error:

Any ideas why? I can’t see anything wrong with my code. Is there anything I need to call before calling remove(), or is there a different way to remove actors?