Had that, twice on my M9. They replaced my sensor both times for free, most recently last summer 2018 after I think they officially stopped doing this.
Unfortunately, the remedy was to send the camera to Leica and pray. They will let you know they got your camera and they might let you know that it's ready. But the communication in between is almost nothing. The first time took literally a few months. The second time only a few weeks.