How to remove an object in bge?
With KX_GameObject.endObject() you request the game object to be deleted.

This call does not remove the object from the scene at that time.

The object will be removed by the BGE after the actuators where executed. It takes effect within the next frame.

Imagine you put a label on the object ... "please remove" (or you put it in the trashcan). The janitor will remove it when cleaning the room.

Remark: It does not matter if you use endObject() or the EndObjectActuator. The behavior is the same.

Care the timing