The simple way to prevent this in the future is the hardest: have an honest conversation about their performance and attitude.
Often times people are not aware of the impact they are having on the organization because nobody has ever told them. They also aren’t fully aware of the boundaries and how they are violating them.
Sitting down and being direct but open-minded is the best approach. Tell them what you’re seeing and ask why they think this is happening. Then reset expectations. Then follow-up.
If that doesn’t fix the situation, then it’s time to part ways.