As an aside, it isn't uncommon to see case captions, especially in older cases, that are captioned, for example, "Jones v. District Court".
These lawsuits involve something of a legal fiction and usually involve what used to be known as "mandamus actions". In this context, a mandamus action is a form of appeal to a higher court with appellate or supervisory jurisdiction over the court sued seeking review of a court order before the entire case is finally decided on the merits (also known as an interlocutory appeal).
For example, a mandamus action might be brought by a party to a lawsuit seeking to prevent the disclosure of documents covered by the attorney-client privilege when the court orders the documents to be disclosed.
The modern trend is to formally treat these interlocutory appeals as a form of appeal rather than as a form of lawsuit against the court. In Colorado, for example, these are now known as Rule 21 actions in civil lawsuits, after Colorado Appellate Rule 21 that authorizes these appeals.
These suits are always brought against the court in an official capacity for non-monetary relief and the nominal court defendant is never liable for damages or litigation costs or usually even for filing legal documents in the case other than the lower court record related to the dispute.