I've encountered this as well in the past. I was the only RnD in my company where i would develop new products which enhances the current products. On the side i would also do what the rest of the engineer do, which were on site installation and support.
My solutions, which consist of new tech (cloud, android, etc) was considered an innovation, and brought in many new customers and also manage to win over customers who were using our competitor's product.
I was excited and contented with it, till the raise came. I found out that i did not get the raise i wanted, and on the other hand my other colleague did. I sat with my manager and discussed about it and his reply was that i was handling new product, while my colleague was handling our main product, which was the bread and butter. I explained that between the RnD, i also do what my colleague did, but he didnt wanna listen. I even created a spreadsheet on all my projects vs my colleague's projects, unpaid overtime amount and etc, which was requested by him.
So as simple as that, i told him i would give him a week to reconsider and sure enough he did not change his mind. The following Monday i tendered my resignation and found a better job elsewhere. thought pay raise wasnt the only reason why i left.
Thought i am proud to say that he begged me to reconsider after getting screwed by the owner, but it was too late as ive already gotten a better offer elsewhere.
In summary, if you have doubts or dissatisfaction with your job or roles, you must voice it out. However you must be reasonable about it too. I believe that at work you must committed 100% to your role. Thinking about what ifs, or why this and that would only serve as a distraction and messes with your performance.
My dad used to say, always have 3 letters ready in your drawer, your Resignation letter, your CV, and your job offer letter.