Yes. Nintendo has a free Joy-Con repair service but you'll need to book a repair through the Nintendo Support website first and send off your Joy-Cons in the post to Nintendo (its free) for approximately 2 weeks or so.
You can still do this even if your console is outside of its original warranty period – thanks to a recent Nintendo policy change. I've had my Joy-Cons repaired by Nintendo once already, and they've started shifting out of place yet again, just over a year after getting them fixed.
So keep in mind that this will always be an issue and even if you get your Joy-Cons repaired the problem can come back at a later time.