When two magnets are placed close to each other they turn and orient parallel. I suppose this is due mostly to spin of the unpaired electrons. But in QM a spin just orients up or down. 1. How are these two pictures compatible? If the spin is closer to up projection the magnet shoud first turn up say 25 degrees and then turn 180 if it flips to down) 2. Where from takes the smaller (unfixed) magnet energy to rotate? (I cannot see how energy is taken from the magnets as they are permanent and stay so for many decades)
Your question about QM is not clear at all and I won't try to answer it.
But the part about, where does the magnet find the energy to rotate: if it is now in a position that is not the lowest energy one, someone, the experimenter, you for instance, put it there. It took that person some work to put it there the way it is. This work has been stored as potential energy. When freed, the magnet lowered its potential energy by rotating. Note that if there is no dissipation, the rotational kinetic energy will make it overshoot the equilibrium energy and keep oscillating. Dissipation will change this energy to heat and eventually the magnet will stop at the equilibrium position.
IMO when the spins are more antiparallel than parallel e.g in the second or third quadrant of the circle they project ac. to QM antiparallel to B. As it is in Einstein de Haas experiment the body receives a rotating momentum and is about to rotate in direction where the small magnet and the external magnet creating B will be south-south or nord-nord. But because of the inertia this does not happen immediately. Then the spins flip to parallel because this is the more energetically low state. So before the inertia lets the body rotate it receives a new opposite momentum and rotates now in the direction where everyone observes it e.g south-nord. It is interesting that this can be confirmed (namely my guess about the reason of the observed rotation - inertia) with an experiment like Einstein de Haas with a rapidly changing direction of B. I suppose the body won't rotate at all because due to inertia it can not follow B (whereas the spins can ac. to QM).