If the court finds that the whole or part of litigation is not subject to its jurisdiction, it transfers the litigation sua sponte to the court of jurisdiction.
裁判所は、訴訟の全部又は一部がその管轄に属しないと認めるときは、申立てにより又は職権で、これを管轄裁判所に移送する。
Notwithstanding the provisions of the preceding paragraph, even if the litigation is subject to the jurisdiction of a summary court that is under its territorial jurisdiction, the district court, upon petition or sua sponte, may conduct the trial and reach a judicial decision itself for the whole or part of the litigation, if it finds this to be appropriate; provided, however, that this does not apply if the litigation is subject to the exclusive jurisdiction of such a summary court (excluding exclusive jurisdiction determined by an agreement between the parties pursuant to the provisions of Article 11).
Read this with the articles around it