Like many things sov cit this originates with something based in reality.
A long time ago in different places and different times, the coroner was separate from the police and sheriffs and was charged with investigating other officials if for some reason the usual officials could not, either because of a vacancy or conflict of interest. Coroners customarily have arrest powers. So if the local sheriff was completely corrupt, you might be able to go to the coroner to get a remedy.
The same could of course be true for a judge who is not doing their job. The problem with that is that judges typically have absolute immunity for their official acts and discretionary acts. The remedy for a corrupt judge is to go to the senior judge or to the governor. The other problem with it is that there’s also a civil remedy for a judge who is not doing their job called a writ of mandamus; it’s basically an application to an a equal or superior court for an order to require an official to perform their duty.