Chosen Solution
It may have something to do with the ribben cable, or maybe with something else in the interior, but the main frame that is held down by the screws was released, and now whenever I reattach it back to the switch, and attach a controller, it ceases to work.
The Joycon rail probably got damaged when it came off. You will have to buy a new Joycon rail to replace the broken one. Nintendo Switch Left Joy Con Sensor Rail Replacement