That would be a great feature to have
Apple used to allow this with their target display mode:
Some older Mac models can use older iMac models as an external display.
support.apple.com
I would love to see Apple bring back that feature - It would be much easier/cheaper for me to just purchase a new M series Mac mini every few years for $599 so that I can just plug it into my M1 iMac (if Apple comes out with a software update to allow target display mode) a bonus would be to allow all the existing iMac features to work while doing this i.e. microphone camera, etc.