It is possible that you are not being intentionally sidelined. This has happened to me, where a company hired a new PM to help us scale, but just took over the parts of my job that I most loved, leaving me with just the drudge work.
I was livid. “We have a new guy... who doesn’t understand the product or our customers or our process... and I am supposed to answer to HIM now‽”
Some advice I wish I could go back 10 years and give myself:
1. “Own what you own” which is a variation of “choose which hill to die on”. If you feel like something is “yours” you will resent people coming in and fucking it up. If you conceptualize something as “theirs” you can feel good doing your best to make it better. Being a humble servant can feel bad, but it feels better than being fired for having angry outbursts (trust me on this one).
2. Understand your feelings well enough to talk about them. That might involve talk therapy. Modern CBT is really great.
3. Remember that anything you love can break your heart. And that is OK. Better than not loving what you do. Maybe it is time for the relationship to end? Maybe you can salvage it?
4. Think and talk in terms of both work/life balance and work-life balance. If having a diverse set of things to do at work is important to you (it is to me, but not everyone) tell the company this. Some people love to be heads down coders in one layer. Other people need to work across more layers. Some people like to do PM or architecture work in addition to coding. Your managers won’t know what you need if you don’t tell them, and you can’t tell them if you don’t understand it yourself. (See #2).
Good luck! You are not in this alone!