The solution is to blow on it, this might sound strange but it actually worked for me. My Right Bumper wasn’t working properly, it would only register some of my inputs. I did some digging and I found this weird fix, I was skeptical at first but I gave it a try and it did not make much difference. Then I pulled in the Right trigger and blew really hard into that gap a few times and guess what, it really worked. I used an app called Game Controller Tester on the Microsoft App store on Windows 10 to check if it actually worked and it did. I also had a similar issue with the A button, blowing into it also fixed the issue with the A button. I have also read reports of people fixing their D-pads this way.
If you prefer to watch the video I made instead of reading the above paragraph here you go.
If anybody knows why this works or have a better solution, please leave it in the comment section below.