One of these will solve the problem
How to Fix Chromecast "Cannot Connect to Wi-Fi" Issue
Chromecast is a streaming device produced by Google. With Chromecast, users can stream videos from their phones and other devices directly to their television, if it works properly.
Unfortunately, many people report receiving the message, “Sorry, Chromecast encountered a network error.” In this article, we’ll discuss the common causes of this error message and some solutions to get your Chromecast working again.
The message “Sorry, Chromecast encountered a network error” appears when your Chromecast is unable to connect properly over your network. Specifically, any issue that causes a network interruption will trigger this error.