yes it works to get them functioning again and thats cool, the black stuff coming out is the silicone lubricant which is kind of important to stop the contacts wearing out. if you could reapply the lube they will last longer but its almost impossible to get it in there without disassembling the encoder.
so… its kind of a short term fix but hopefully it lasts a long time for you.
the MDmk1 had some nasty batch of encoders that wear out really fast… i did what you did too to get more life out of them but ultimately they all needed replacement, some of them twice! the jog wheel and analogue volume pot are notorious. if you plan to do it, i suggest marking around the jog wheel encoder at its base on the PCB before removing the old one, this is to get the new one in exactly the same position as its very hard to get the wheel to line up perfectly with the faceplate again otherwise. btw i replaced my jog wheel encoder with an ALPS one the second time, much better quality. the shaft was slightly longer though so it needed trimming. hope this helps!