I ran into this same error with AMA. I updated the Azure Windows VM Agent which then allowed the AMA agent to install. This agent is automatically updated when you use Azure marketplace images, but is not updated after that point.
Here's a reference to the agent information: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/agent-windows
Following the link on the page will get you t9 the download link for the latest .msi which at this time is the following which you can install with admin rights on the VMs with the issue: https://github.com/Azure/WindowsVMAgent/releases/download/2.7.41491.1139AMD64/WindowsAzureVmAgent.amd64_2.7.41491.1139_2408131139.fre.msi
From there just ensure that a previous failed AMA agent extension is uninstalled and then re-install the AMA agent.