I am also having this issue. But I'm running an earlier version of Xcode (for reasons of unsupported frameworks).
Details
Lost connection to the debugger on “iPhone 12 Pro Max”.
Domain: IDEDebugSessionErrorDomain
Code: 4
System Information macOS
Version 11.4 (Build 20F71)
Xcode 12.2 (17535) (Build 12B45b)