If goal is learning how to programming advanced stuff it doesn't matter you coding a game, or game engine or a physics stuff. In the end of your projects you will have enough experience to make any of it. And when they are not a challenge anymore, you won't want to make a physics engine or game engine anymore.
You don't just learn to 'program advanced stuff'. You learn how to write a certain thing. You can't specialize in writing 'hard software', you can't learn techniques to better write 'hard stuff'. Writing a physics engine will not give you the experience to write a game render because both are 'advanced stuff'. If you goal is to learn about programming, learn programming doing something practical that you enjoy. Writing a physics engine just before you write a game won't learn you much more than the other way around, it will just be longer and buggier. Why not write a game and then write a toy physics engine while having in mind what a game expects from a physics engine? Much better idea in my opinion.
I don't believe in argument called "re-inventing wheel" in programming. Since if you don't copy and paste code from other people's works, It wont end up as same wheel. Yeah they will have same purpose ( reducing friction ). But their shapes will be different, their material will be different and they will vary in structures.
So first you say that re-inventing the wheel doesn't exist in programming. You back this up by saying that reinventing is not copying line-by-line (duh), and then you describe the process of reinventing the wheel, and what kind of fucked up wheel you could end up with.
This is exactly what re-inventing the wheel is.