The chosen answer, while helpful in the vaguest ways, was about as much a canned answer for generic electronic issues I could see.
Microsoft has a few known defects in the controllers. One of which is a smoothing capacitor on the board that has a propensity to short out. When this happens it will not power the unit (controller).
If you have it apart (Microsoft warranty is always the best route) then look on the bottom of the board around the lower left of where the D-Pad engages.
Another issue is that the “B” button is on a separate board and it’s not reinforced enough. This normally causes much more significant issues like 100% failure of the controller. You’d know by looking between the two control boards and seeing one of the board sockets pull off the board.
I do not think this is your case based on what you have described though.
Look at the cap for damage or signs of over heating. Let me (us) know what you find.