Agent fails to receive the tasks because it is not registered to any task server.
When trying to reset the agent, in the logs we see:
Release : 8.x
Task server assigned to the agent and site is not reachable or is turned off, and because the Notification Server is not a task server, agent cannot even register with it.
By default the Notification Server is also a task server and when an agent cannot register with it's own task server, it will register with the notification server instead.
But in some environments like this example, people uninstall the task server from notification server. So, when the task server is not active, the agent cannot register with anything else.
Make sure the task server is active and reachable.
You can also install the task server on the Notification server as an alternative option.