As a workaround, restarting only the iPhone works for me, but has to prepare like @mungbeans said.
Even after upgrading my MacOS from Ventura to Sonoma the problem persists.
Current versions:
Mac: Sonoma 14.3.1
Xcode: Version 15.2 (15C500b)
iPhone: iOS 17.4.1