Google's John Mueller was asked by Mihai Aperghis in a webmaster hangout at the 58 minute mark about a page Mihai 404ed but Google is showing as a 301 to a new URL, like Google canonicalized the 404 URL to the new URL.
Mihai asked "Google doesn't see the old URL as a 404 and the new URL is a brand new URL. It just sees the old URL as a canonical to the new URL and I don't know how to make it kind of see that that one is a 404. Using a test live URL it does show a 404 but doing the normal URL inspection it just show the Google site the canonical is now the new URL instead of 404."
John said it is possible that Google is trying to do that on purpose. John said "I could imagine our systems are doing that on purpose to help people who aren't doing redirects properly. So maybe that's a case where we're being more helpful for you than you want us to be. Because if we can tell that the content is the same and like it disappeared one URL and it reappeared somewhere else and I could imagine our system saying well this is your you're kind of shifting the canonical from one to the other."
He didn't have a good solution to override Google being too smart outside of trying to change the content on the new URL page drastically. That won't really work for Mihai in this case. Mihai just wants Google to respect his server status code.
Hat tip to Glenn Gabe:
The new url, which was a complete duplicate of the old url that was 404'd, is now ranking exactly where the old url ranked for queries. So Google is treating the 404 like it was canonicalized to the new url (even though it 404s). Again, fascinating. :) cc @mihaiaperghis https://t.co/Pa1FgA3lgO
— Glenn Gabe (@glenngabe) December 17, 2019
Note:
Right, signals were passed just like it was a 301 redirect, including PageRank. Fascinating example. Are there others on the site this is happening with?
— Glenn Gabe (@glenngabe) December 18, 2019
Here is the video embed:
Forum discussion at Twitter.