For anyone having the error: Invalid object type for field ‘publisher’ using the RankMath plugin.
Go to RankMath Settings > Titles and Metas > Local SEO. Change Person or Company to match the correct values. I had my website address as a “Person”, which is not allowed in Google AMP validation.