Yeah some overnight trains can adjust their gauge on the France/Spain border.
On the China/Mongolia border on the other hand they disassemble the train, lift the train cars up one by one (with passengers inside), switch out the boogies and then reassemble. 3 hour process, you can fully sleep through it and not notice.
If it’s taking 3 hours on a passenger train, a 5-10 minute transfer seems vastly more efficient.
For day trains as well, more often within Spain than on the border with France.