Network Error: The Companion has disconnected

I tried everything, I even rebooted the router and also tried to connect from another phone, please help

Welcome.

Lots of things can cause a disconnect. Here is a link to some reasons this can happen regarding Companion disconnections. The links might provide your solution.

Link does not work

try
https://community.appinventor.mit.edu/search?q=companion%20disconnect