Minecraft Server Error Failed to verify username
The failed to verify username usually happens when your account can't authenticate with Mojang's servers. This guide will show you how to fix this issue.
1 Close your Minecraft client.
2 Log Out of your account from the Minecraft launcher.

3 Log back into your Minecraft account within the launcher.
4 Launch Minecraft and connect to the server to verify that your Minecraft account is real.
Mojang's servers
In some cases, Mojang's servers could be offline, your account can't be verified in this case. You would just need to wait for the Authentication servers come back online.
You can check if the servers are online Here - While this is the Unofficial site, the official Mojang status Twitter(X) account is also put on that website.