167. If an application is brought before a court other than the court of competent jurisdiction, a party may ask that it be referred to the competent court or, failing that, that it be dismissed.
Lack of subject-matter jurisdiction may be raised at any stage of the proceeding, and may even be declared by the court on its own initiative, in which case the court adjudicates as to legal costs according to the circumstances.