You use the toy guns as a teaching tool. You explain how to handle a real gun using the toy gun. There are lots of teaching aids that are not the real thing even in the adult world. A child will not be confused between a toy gun with a red tip and a real gun. You train them.
Pretending the toy gun is real and has similar safety concerns teaches the child the real gun is like a toy and not that dangerous.
I greatly disagree with this approach and teach my children how to use and respect real guns. I don’t teach them how to drive with toys either.
Any equating of the two lowers the respect for the possible harm from the real.