Target Display Mode which turns iMacs into monitors is not supported on newer iMacs (anything post 2015):
I use https://astropad.com/product/lunadisplay/ to use my iPad or an old Mac's screen as a secondary screen and it's good.
Do Mac's not have USB ports? It's truly bizarre that you need 1 thunderbolt port per monitor. That's an incredible amount of wasted bandwidth.