I have had a very similar problem with MacBook Pro and Samsung external display. So after an hour on support to Apple and Samsung doing PRAM resets etc and both blaming each other, Apple mentioned that third party software could be causing it. I was running Flux (which is a colour temperature app. Like nightshift). Removed that and it worked instantly. Check any third party apps that might be running in the background and then reintroduce them. Good luck everyone!