How does this control loop work?
How is this control loop supposed to keep the output voltage steady
regardless of for instance, load variations, if the error being
reduced to zero would actually stop the switching?

Basically, and in a nutshell, the error cannot reduce to zero. In a practical controller, the open loop gain may be numerically a thousand to 1 million so, if the output is (say) at 50 % of its range, then the error signal magnitude is a tiny fraction of 1 %. There has to be an error (no matter it being small), that drives the output to very, very close to the demanded level.
Exactly the same story for an op-amp; we say that both inputs are at the same voltage but that isn’t, strictly speaking, the precise truth.
And, in addition, if I address this point: -

the error being
reduced to zero would actually stop the switching?

No it wouldn't because of the comparator and triangle wave shown below. They ensure that the system remains clocking out at the required duty cycle: -


Regards your simulation, now that I've had a good chance to look at it, you haven't got enough &quot;gain&quot; in the system to drive the error towards an acceptable value: -

Your error amplifier is only a gain of unity so, try adding a gain of ten stage between the op-amp output (U3) and the purple error box shown above. If things start to look unstable you might need a few pF across R11. If OK, proceed to increase the extra gain factor higher and higher. As you do so, the actual output will move ever closer to the target demand.