It should not be possible for the ZIF connector to become undone inside the Joy-Con since you have never opened it because they are designed to stay in place firmly until you unlock the connector so there might be another problem internally with the Joy-Con because if you have dropped it something could have come loose or broken or there could be water damage or corrosion on the Joy-Con rail where it connects to the Nintendo Switch or to the Ring-Con. I am not 100% sure what could be wrong with the Joy-Con and you may need to disassemble it and inspect the parts but there is also a risk with opening Joy-Cons you might damage the ribbon cables connecting to the rail and that could kill the rail so it would not be able to connect (physically not wirelessly) and charge.
The problem might be that when you opened up the Joy-Con you may have damaged the ribbon cable going into the rail. You may need to replace the entire rail because the ribbon cables are attached to it. To check if the rail has been damaged you can see if when you press a button that the lights on the side still work and you can also open up the Joy-con again and see if the ribbon cable has any creases in it because the cables are so fragile a little crease in the cable can kill them permanently.