SQL Server Agent & sp_send_dbmail failing on permissions
It seems that the SQL server agent User has some problem to run sql cmd.
It uses sql cmd to run the query to attach in the email.
Please try to to give the agent user the database mail user role.
exec sp_addrolemember 'DatabaseMailUserRole', 'domain\agentuser'