Hello,
Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
As soon as Google sees a 404 status, that’s as far as it goes, it doesn’t take the content into consideration, so it doesn’t matter if there’s a noindex, a nofollow or nothing, it’s ignored and the page will be dropped.
That’s true too if googlebot follows a 301 redirect to that 404 page.
There’s perhaps not an explicit doc, this covers how Google handle different status: https://developers.google.com/search/docs/advanced/crawling/http-network-errors#http-status-codes
Please do note this part “Google’s indexing pipeline doesn’t consider URLs that return a 4xx status code for indexing, and URLs that are already indexed and return a 4xx status code are removed from the index.”
We hope that helps. We are here if you need us again.
Thank you