There are a lot of people who are very good people with very good skills that also happen to be in the wrong role. When this is true, they struggle to produce the results their company needs from them, making the company unhappy with their performance. The person in the wrong role is also unhappy because they are trying to be valuable but struggle to do what needs to be done when it is work they should not be doing. Over time, both the person and the company become frustrated with each other, especially when this mismatch is allowed to go unaddressed for a long period of time.
If you are responsible for this person on your team, your first obligation is to determine whether you can train and develop them to succeed in the role in which they have been placed. The only way they will ever have a fair chance to succeed is if you provide them the mindset, skill set, and toolkits they need—based on where they are now. When that isn’t enough, you must be fair to the person and find them a role in which their skills will be valuable. If they can be reassigned to a role that suits their unique skills and abilities, you need to help them find that role.
If you are the person in the wrong role, your responsibility is to recognize that even though you believed you were right for the role in which you find yourself, you really need to do something else. There is no reason to try to tough it out if you are miserable and failing. Instead, start seeking out another role within your company where you believe you can make a difference. Then ask for the opportunity to be moved to that role.
In the end, your company will be a lot happier with you in the right role making a greater contribution, and you will be much happier doing better work and work that is aligned with your skills and abilities.