Changed the stress
Wearing heels over a prolonged period of time creates a muscle/tendon memory
pattern- meaning these soft tissues are used to being in a certain position.
Then, when you change to flats, you have put these tissues in a new and uncomfortable position. One example is the achilles tendon area. When wearing heels, you take tension off the tendon/calf muscles, and then going to flats stretches these.