Hey there it's been a while since I used anything related to ai2 so take it with a grain of salt. So I think the problem could be as simple as using http and HTTPS or even your firewall blocking it so look into that as for me I think I faced ithis issue and I think it was firewall issue but again it's been quite long since I used ai2 so I might be wrong
Try https://community.appinventor.mit.edu/t/how-to-create-own-app-inventor-only-for-windows/44690