wait, what?
The last dozen posters who complained about this not working were not following ANY of the rules, and you are following them ALL.
Use your iMac as a display with target display mode - Apple Support
so I presume you are already logged out of any user on the iMac and have pressed Command-F2
have you also tried any of these?
To get a Mac display to become active, you need the Mac to query the display, and the display to answer with its name and capabilities. Otherwise, the display will not be shown as present, and no data will be sent to the display. "No signal detected" is generated by the DISPLAY, not by the Mac.
This query is only sent at certain times:
• at startup
• at wake from sleep — so momentarily sleeping and waking your Mac may work
• at insertion of the Mac-end of the display-cable, provided everything on that cable is ready-to-go
• hold the Option key while you click on the (Detect Display) button that will appear in Displays preferences (from another display)
so try doing some of those things and see if the display comes alive.