The below line came from the recent chapter of hige wo soru manga. Yoshida told Sayu about how he met his ex girlfriend who suddenly joined his workplace. His ex was his high school sempai. Sayu had a monologue that went like this
I can't grasp the overall meaning of the bold part. How to understand the「どこか...とか...とか...なんだ」structure? What does 勝手に無いように mean? If possible, I'd appreciate a literal English rendering.