I tried the start-transcript and it confirmed that the gmsa do not see the taskname, so in the send-mailmessage cannot read the body and it doesn't send any emails.
In the task schedule the task result is succesfully.
I setup this script in a couple of different forests, I notice that for 1 of them it works, could be some GPO that block it?