Let me tell you a story.
I once ran a team into which was dropped a grumpy and rigid old-school programmer. He was unhappy to be landed with me and I was similarly unhappy that this ugly duckling had been dumped into my budget. Fortunately I had through personal experience one insight that served me very well: if you cannot get efffective work out of someone it is probably because you did not find the right framework, the right goals and match with their skills. You, as a manager, did not do the due dilligence to locate that thing which needs to be done which the person you are confronted with will do well and (hopefully) enjoy. I finally found a task within my purview which needed doing and which this person did well. He never quite got over the grumpyness, but he became more positive and gained respect from other team members for a job well done.
It can be a tall order. It may be that the right frame for your ugly duckling,is not in your team, or even your company. But do not make that judgement too soon. I work as a project manager and I and my colleagues are therefore often dropped into a new context. I have very often seen and personally experienced that the same person working in two different contexts within the same organisation went from excellent to not merely less capable but incapable. Subtle differences in management styles and culture can make a huge difference.
This, of course, also applies to you.
Look carefully at the social, functional and managerial context in which you are working. Have you suddenly found yourself struggling upstream rather than going with the flow? Are you suddenly the black sheep? If nothing has significantly changed in your life and attitude, it could be that you are in the wrong framework. You may need to look carefully at the situations, groups and tasks where you excelled and enjoyed your work. That is your frame and you will be happier fitting in to it.