Sometimes things change and people get feelings. Sometimes not everyone is on board for the change that happens though. And that is honestly alright as long as both parties involved understand where exactly things are heading. This way, it doesn't hurt as much when you know you have to say goodbye.
...That's not to say it won't hurt at all. It always hurts when you have to say goodbye to someone you built any kind of relationship with. However, if you know when to say goodbye, then you have more of an opportunity to learn from the experience and maintain some kind of friendship between both parties.