you cant delete something INSIDE physics step
eg: you want to remove the bullet when a bullet hits a wall, you add collision callback between bullet and wall. in this callback, you tried to delete bullet.
this won’t work, as callback is still inside the physics step.
what you can do is:
label the bullet as “to delete” in collision callback, then when the physics step is finished, during your normal game loop, you can then delete all objects that has marked as “to delete”