As of 2022 RankMath is our favourite plugin for WordPress SEO. The problem appears that RankMath has poor defaults for 404 checking and redirects. These settings might be off due to performance reasons.
The two places where you should focus to turn them on are here:
WordPress Dashboard > Rank Math > Dashboard > Modules
Next click Settings, and turn on auto post redirect here: