There are some great beginner-level apps like Box Island, Lightbox and programmable robots. My son loved those, but outgrew them.
After that, Swift Playground does a great introduction to coding with actual text. My son loved it, but there isn't much to do once you've finished the Learn to Code activities.
There is also Scratch, but my son tended to just diddle around with the games rather than learn anything.
Then when you get really advanced, you can solve puzzles in Leetcode, and do various coding tutorials that assume you can code pretty well. My son isn't ready for that stuff yet.
So what is the right stuff for a kid who has outgrown the Learn to Code 1&2 tutorials in Swift Playground, but isn't ready for Leetcode? He's a kid, so he needs structured exercises he can complete, or otherwise he'll just diddle around. And he needs something visual so it's entertaining.
Now at 12 he splits his programming time between Lua/Roblox, C# (built a voice recognition "Jarvis" app mostly on his own) and some basic C to interface with Arduino components.
Here's an example of what it looks like: https://www.youtube.com/watch?v=7O2fSZ0OwuE
It's used in agent based modeling, so there are layers of education possible in learning the language and the many models that come with it.
Another thing I totally recommend is a Raspberry Pi Pico (very inexpensive), a Pico Explorer Base, and a handful of electronic components which are easy to find in kit form. There he can learn electronics and the Python programming language at the same time. I have one and I really enjoy jamming on it.