In certain Field Research quests, the reward for completion is a mystery Pokémon encounter.
I have been doing the last stages of the Let's Go Meltan quest, and one is to catch an Aerodactyl; and where I live, we don't really qualify for any of the spawn locations. So outside of raids or potentially hatching one, (which I don't think counts anyway), they are incredibly rare for me to find.
However, I recently completed a Field research quest (I don't know which one) and was rewarded with an Aerodactyl! I have no idea if this is linked or not, as the last one I caught was nearly a year ago, and I only just started this stage of the Let's Go Meltan quest this week.