Would it work? yes, it's a tried and tested mechanism, similar to most spring air guns.
If you're really interested in the mechanics of it, it's worth a visit to
this website,(the more useful links are about half way down the page)
The theory is sound, It is however, as I have found out the hard way, quite difficult to pull off in reality, especially without access to machining equipment. If you do, great, it's a simple and effective design, otherwise, it's certainly possible, but I found making a lightweight, low friction but good sealing piston is quite a challenge out of botched parts.
Also what is often overlooked is a good sealing detent for the barrel, one of these can boost power for a springer quite considerably.
One point I also think is worth mentioning is be careful with build quality, and don't overdo it with the spring, a badly made springer can be quite dangerous (strong compressed spring very near face) especially if this is going to be your kid using it.
There are quite a few examples of people who have pulled it off successfully, both machined and non-machined, I'm sure I can find them somewhere if you are interested.
But otherwise, yes, if you have the build skills then it's a good design, and as you have drawn it will work.