

Another vote for scratch. Most kids that age want quick results and not to spend ages debugging something. Funnily enough I’ve seen the same scratch interface used to program industrial robots.
How much time one on one are you committing to spend with the child? This will make the difference.
Alternatively, think about some sort of robotics kit. Doing stuff in software is great but if it changes something in the real world, even better. Have you thought about something arduino?
Just for balance though, make a raft, a treehouse, a tent, make a fire without matches. It’s all problem solving but I bet any kid will remember getting muddy more than writing a neat while loop.
Bedtime doesn’t equal sleep time, but is a good discipline to start making ready for bed and putting devices away. Getting ready for bed at 10, asleep by 11 doesn’t sound bad to me.