I have similar issue on both of my iMacs with Big Sur 11.4 while External 4K dell screen is connected. No issues yet when using standalone!
I have a workaround that might help others as well.
I've noticed I mostly (or maybe only) have this problem while using Safari and Webkit applications! such as Appstore, Xcode etc.
As a workaround close all apple applications to avoid Webkit and use Firefox instead of Safari and let me know if this helps you or not!
I believe people who still have Apple support should raise that and notify Apple team at first place.
You can also report the issue through "Feedback Assistant" on your mac.
Hopefully Apple will fix this problem in coming updates!
Cheers!