I've not tried it but if you've got some electrical contact cleaner you could spray some in, move it around a bit and see if it resets back to centre. Let it dry out for a bit before powering it on.
As far as I know a lot of controllers (joycons, DS5, etc.) Have the same issue as they all use the same internal part.
You could possibly order one and have a go at replacing it. Seems a lot for something defective pretty much right out the box though.