I made the mistake of buying a 27" Intel iMac in 2019. Five years later, I had a great-looking display that I loved housing an obsolete computer. And Apple doesn't allow you to use the iMac as just a monitor.
I didn't want to go down to a 24" iMac and have the same issue in five years. So this year, I bit the bullet and bought a Studio Display and an M4 Mac Mini (I traded in my 27" iMac.) Yes, the Studio Display is overpriced, but the 5K display matches the Mac OS native resolution perfectly (double the resolution), so it looks great. And it is Apple, so there are no issues with using it with the Mac mini. And in five years, I will simply buy a new Mac Mini and keep using the Studio Display.