I've installed 13.5 Beta 3 to test if the issue is fixed. Unfortunately doesn't seem to be - WindowServer still crashes when plugging in dock with displays connected. Although, a popup appeared once it recovered, saying WindowServer crashed and prompted me to submit the logs to Apple. Hopefully they'll look into it now I've submitted the logs.