How to use QMI to query Modem info in Linux?

So, it’s in MBIM mode then.

That “sometimes” is because you have other programs using the control port at the same time via the proxy, like ModemManager. If you don’t use -p, then you’re hijacking the control port from the proxy each time you run a new command, so you’re effectively breaking the communication of the proxy, and the other way around. If you have at least one application using the proxy, then all applications must use the proxy as well.

Could be because you’re using the wrong WDS client to query. If you connected via ModemManager, you can rely on the connection status reported by ModemManager. You can see all the QMI messages transferred to/from the modem if you run the MM daemon with --debug; see Debugging | ModemManager