The answer to the first is straightforward: iOS 17 has new debugging infrastructure such that all debugging goes over the network. That’s not the same thing as going over Wi-Fi. If you have the device attached via USB, the network requests will go over a virtual network interface running over USB.
If the new architecture of iOS17 is entirely network based, then there is actually a reason to explain this behavior, it requires a usb shared network to be established when using a usb connection to Xcode, however on the iPhone a usb shared network conflicts with wifi, you can only use one of them at a time and wifi has a higher priority. When you manually turn off wifi, the usb connection still doesn't automatically become a usb network, because your Mac is connected to wifi at the time, and when the Mac's wifi is turned off, the usb connection officially becomes a shared usb network, and takes significantly less time to transfer, and shows the shared network logo on the iPhone.
This is just a hypothesis, but at least for me, Xcode worked fine after the usb shared network was established.