When forwarding a SSH agent to a remote host then switching user with sudo, the agent will not be preserved. This can happen if you SSH to a server as <username> and then want to become root.
To start start a new bash session as root with the agent preserved:
sudo -HPEu root bash