If this wrong attribution happened in RG, please contact RG support team as soon as possible. They would solve the problem at the earliest possible, I believe.
It happens when Names match. It wont automatically add to the names matching. When we search the article by mentioning author name , Article appear in all the discipline article which matching Author Name/ Search Name., its our responsibility to select correct one. If our article wrongly selected by other person. we can remove them or Mail to Research Gate Team asap. mentioning the issue.
There is a "Claim authorship" function. Go to the paper and click on the small arrow right of "Request full-text" (or "Download", when the paper has a full text).