The only requirement for Pokémon to be transferred into Sword and Shield is that they need to exist in the game's somewhat limited Pokédex. Therefore, attempting to transfer a Rattata you found in Pokémon GO to Sword and Shield won't work because the purple rodent was cut from the Switch games.