In addition to this, what helped me get it working was, turning on background services for "your phone"
you can find this on your windows pc > settings > background apps >your phone > on
I'm using pocophone f1 running android 10
Thank you soooo much. Mine was connecting fine on one machine but on the other would connect for 5-10 seconds then disconnect. I spent an hour troubleshooting before finding your post about background apps on the PC which fixed it for me.