Treadmill walking isn’t real walking.
Was it a treadmill stair climber as well?
How is it not walking?
There are certainly trade-offs, certainly if you have the option of walking in a diverse real location that would be better than a treadmill.
Different terrain, different elevations, not the same repetitive motion over and over again.
3 miles in a treadmill does not feel like 3 miles on a track or park.
Try it yourself. There’s different muscles in my feet that get tired. I’m sure a treadmill is better than no training at all, but if you are aiming for a 5k try to do real walking or running.
This is just like cars that consume more fuel in stop and go traffic than when cruising down the highway. It wouldn’t surprise me if it were a universal law.