the problem is the following: You are not really “moving” anything at all, all your code does is specify a new x position for the Box2DBody within the BoxCollider within the Entity. That’s why it looks like the collider is moving without the entity, well in fact you are just changing the position of the collider within the entity.
Instead you should move the entity itself, which will cause the collider to move with it. And here is how you do that:
The parent of the body is the boxcollider and the parent of the boxcollider is the entity. This means instead of “selectedBody.x” you need to change “selectedBody.parent.parent.x”. You could of course save the selected entity in a property variant (like the Body), to make it more readable than lots of .parent.parent calls.