It is not possible to play a single physical copy of Animal Crossing on two different Nintendo Switch consoles at the same time. Each Nintendo Switch console requires its own physical copy of the game to be able to play it.
However, there is an alternative way to share the game between two consoles. If both Nintendo Switch consoles are owned by the same person, they can use the same Nintendo account to download the game from the Nintendo eShop on both consoles. This way, the game can be played on either console, but not at the same time.
It is important to note that the two consoles need to be connected to the internet to access the game, and that only one console can be designated as the “primary” console for the account. The primary console can play the game offline, while the secondary console needs to be connected to the internet to play the game.
Additionally, if the two consoles are owned by different people, they cannot share the game in this way. Each person would need to purchase their own copy of the game.