GameMaker is pretty much the best game engine to get introduced to programming. It has a visual scripting tool that lets you write basic logic without any raw textual coding, but also provides a smooth transition path to learn an actual scripting language (GML) when the child becomes more ambitious. I’ve started programming at a young age thanks to this.
(Godot had a visual scripting system but they removed it in 4.0. And it wasn’t really intuitive to learn anyway, compared to how GameMaker does things.)