If, during any inquiry into an offence or a trial before a Magistrate, it appears to him at any stage of the proceedings, before signing the judgment, that the case is one that should be tried by the Court of Session, he shall commit the case to that Court in accordance with the provisions outlined earlier. Upon such commitment, the provisions of Chapter XVIII shall apply to the commitment made.