Mechanism of ring opening of amine combined with formylation
This reaction is very similar to Reimer-Tiemann reaction which also consists of the reagent $CHCl_{3}$ + $NaOH$. The mechanism of that reaction is believed to have dichlorocarbene intermediate too. A good point to remember is that the dichlorocarbene intermediate is often used to form cyclopropane or carbonyl groups.

This is the mechanism for the reimer tiemann reaction. We can see the similarity in the this reaction and the one you have mentioned previously.