I'm pretty sure metal loses more of its structure as it heats up, so...how does the difference in rotation of Earth's liquid inner and outer core generate any kind of magnetic field? Why wouldn't the magnetic field be even stronger if those two layers weren't rotating?
It seems your question assumes that Earth magnetic field is caused by natural magnets inside the Earth. Instead, the magnetic field comes from the movement of charged particles.
Any electrical charged particle in movement generates a magnetic field (see Biot-Savart law and Ampere law), hence, thanks to the movement of particles in a liquid mantle we have a magnetic field. Obviously, particles must have electrical charge, which is more common in metals.
If mantle turns solid, movement is gone, and the magnetic field reduces its strengh.