Was asking because if it was installed wrong, you will have injection issues. But, it will generally not stop when commanded either if this is the case but it still could shut down. There is an inspection window to see if it is in the "fork" as it should be. In these videos, I talk about that;
Did you check the valves?
Flames coming out the exhaust is making me think timing, valves, or gasoline put in the tank.
Whatever you do, don't use imitation parts with these. The "Chanmar" stuff is TERRIBLE. It may look the same but the quality is horrible. Make sure the copper washer or cup seal is good when replacing the injector. Yanmar calls them a one time use item, but if they're not damaged during removal, they will 99% of the time seal up again. Especially if it's the first time you have pulled it.
These are very simple little engines.