Hey there Richard,
Thanks for reaching out to the Apple Support Communities. To get started, does this issue occur if you connect your MacBook Pro directly to the display rather than through a hub? If so, we'd recommend testing the issue in safe mode to help isolate the issue further.
This can be used to help determine if the issue may be caused by some software that loads as your MacBook starts up. For steps on how to boot into safe mode, and what to do if the issue does or doesn't occur in safe mode, check out this link here: How to use safe mode on your Mac - Apple Support
Apple silicon
1. Shut down your Mac.
2. Turn on your Mac and continue to press and hold the power button until you see the startup options window.
3. Select your startup disk, then press and hold the Shift key while clicking “Continue in Safe Mode.”
4. Log in to your Mac. You might be asked to log in again.
Keep us updated on the results, and we'll continue from there.
Have a great day!