[how reaction actually happens

I wonder is it possible for aniline to undergo Reimer-Tiemann reaction just like phenol? What is the problem in that? How to compare rates of carbylamine reaction and RTF?
The reaction of aniline with chloroform and base (Hofmann isonitrile synthesis, 1867)[1] predates the Reimer-Tiemann reaction (1876)[2] with phenol by 9 years. Strong base reacts with chloroform (1) to form dichlorocarbene (3). The sequence 3 $\rightarrow$ 9 leads to phenylisonitrile (IUPAC: isocyanobenzene). The electron pair on nitrogen in structure 6 can also, and likely preferably, be used to eliminate chloride leading to chloroimine 7.

The course of this reaction is notably different from the Reimer-Tiemann reaction. While the mechanism explains the results, it does not answer why reaction doesn't occur on the aromatic ring. Consider the reaction of phenoxide (10) with dichlorocarbene (3) using a similar mechanism to afford phenylformate (15). This ester is particularly labile to base with the irreversible formation of phenoxide. This process is a dead end; eventual reaction on the ring occurs irreversibly.
One might ask why a similar course of events doesn't occur with base and chloroimine 7 leading to N-phenylformamide (16). N-Phenylformamide is less labile toward base than phenylformate but, if N-phenylformamide is formed, it would be capable of being dehydrated by dichlorocarbene to form the protonated phenylisonitrile 8 just as reagents such as $\ce{POCl3}$ do. I leave it to the reader to write a mechanism for the reaction in the red box.
In summary, both aniline and phenoxide may react kinetically on their respective heteroatoms, except that in the case of oxygen, the reaction is non-productive providing an opportunity for an irreversible reaction on carbon.