AttachActorToComponent Replication

I am trying to attach an actor to the socket of a sprite (that is under a Paper2DCharacter blueprint) after a certain keypress, and then detach the actor when the same key is pressed again (basically an item pickup). In standalone, all works well, but when running it on a listen server the behaviour is inconsistent.

From both the server and client side, sometimes the actor perfectly follows the sprite, and sometimes the actors movement is not replicated until the actor is detached.

Another strange behaviour, that only the client side experiences, is that the other player will start shaking erratically while holding the actor. And the client side player themselves will also experience the same behaviour. This weird behaviour stops once the actor is detached.

Please help me, I’ve been stuck for days now…