For the matter of your Joy-Con working in handheld mode but sometimes disconnecting when moved about, there's a likelihood that the issue is debris or dirt on the connectors. You can access the connectors on the Joy-Con rather easily simply by opening it up. Wipe the connector(s) down with a cotton-swab and IPA and check if things are working well. Make sure the lower ribbon cable is properly attached while you're at it. If this doesn't solve the issue, then it may not be your Joy-Con but, in fact, the connectors in the rails of your actual Switch tablet that need to be cleaned. This can be done with relatively little trouble given you have the right screwdrivers, a cotton-bud, IPA, and a scarf pin or the like.
To confirm that it isn't your Joy-Con, you can try attaching another pair to the tablet and seeing if they face the same symptoms, but if that option is not available, you can simply give the fix a try any way. Turn off your Switch completely. Reference this useful iFixit guide up to -and including- step 8. From there, you'll want to do step 17 for one side. You do not have to disconnect the ribbon cable from the console, but you should be careful handling the rail to avoid damaging it.
Look at the following image marked for your reference:
The portion of the rail I've circled in red has a bright pin present. This is a retainer pin. To dislodge it and gain easy access to the connector, push it out all the way to the other side (don't lose track of it) using the scarf pin, and the connector portion of the ribbon cable will be accessible. Saturate a cotton bud with IPA and gently clean the pads, ensuring to remove any debris. Once done, reposition the connector in the metal rail and push the retainer pin back through. This should keep it in place sufficiently. Reattach the rail to the tablet, and you'll have finished the job for one side. Take care of the other side if necessary in the same manner and reassemble the tablet's panel. You should find that the Joy-Con no longer disconnect in handheld mode if the problem was from its end.
I hope this helps for the matter of connectivity when you're attaching the Joy-Con to the tablet. As for the wireless issue, I'd like more detail if you have any to see if there's any reasonable solution you might be able to pursue. As a preliminary possibility, your Joy-Con's antenna may have been damaged or undone. I've highlighted the connector on this image from another guide for your reference:
Try to ensure that it's properly seated and check the length and end for any damage that may have resulted from the fall.