iMac as a display with target display mode has stopped working
I've been using an iMac 27" Quad-Core Intel i7 (late 2013) as a target display with my MacBook Pro 13" (2018) 02.7 GHz Quad-Core Intel Core i7 for over 5 years. It's worked fine but this week it has stopped reconising connecting when I press 'command' + 'f2'. There's obvious no way to check anything in the settings. Any pointers?
Imac - OS Catalina 10.15.7
Macbook Pro - Ventura 13.5.2
MacBook Pro 13″, macOS 13.5