I tried this, but I ran into a few issues that I couldn't live with, some of which are touched upon above;
- You have to put the iMac into target display mode every time you turn it on, which means connecting a keyboard and pressing CMD+F2. Anything that causes the Mac mini to disconnect - sleep mode, a reboot, shut down or cable disconnection - will require you to CMD+F2 on the iMac again to reconnect.
- The above makes it quite annoying to get into recovery mode on the Mac mini as you have to boot it blind, before switching on the display.
- The iMac is a proper computer, so power consumption, heat generation and fan noise is comparatively high for a monitor.
- You can't use the camera, mic, USBs, Firewire, SD card slot, ethernet or audio jacks as you can on the equivalent Thunderbolt Display.
In the end, I just bought a £200 HP 1440p LED-lit IPS display for convenience. And in spite of being so cheap, the picture quality was dramatically better than the old, yellowing, tube-lit iMac panel. Monitors have come on a long way in the last fifteen years!
If you can make it work for you, it's a great way to recycle an old computer, but it was just too clunky for me.