This annoyed me for years. I have cases but I use dock and portable 50/50. Cases were annoying. Someone suggested the simplest thing that fixed: small amount of masking tape on the bottom of the tablet (on the outsides) where the joycons slide on. They stay on super firm now and I've only replaced the tape once in the past 3-4 months.
An example someone showed me with electrical tape (I used masking):
https://i.imgur.com/EsS8JEF.jpg