This easy to follow video demonstrates how to replace the Nintendo Switch Slide Rails. On my Switch, the Joy Con would often disconnect during game play... I thought it was the controllers only, but after replacing them with new ones...the problem continued. Then I realized that the problem had to be the metal rails that held the Joy Cons to the main body.
If you have this problem and have already tried replacing, or even cleaning the Joy Cons...maybe this is your solution.