Yes, your save data carries over.
According to Nintendo Support:
Where is game save data stored?
On Nintendo Switch, game save data is stored on the console’s System Memory. This will not change whether downloadable software or software from a game card is being played.
Game save data cannot be saved or copied to a microSD card.
As to whether you can still access those saves when you buy the digital version:
Can save data be used between physical and digital games on Nintendo Switch?
Save data is stored in the System Memory, and for the most part, it is associated to the individual user. So long as the same user is selected on the console, the save data will not be impacted whether the software is played from a game card or downloaded from the Nintendo eShop.
It's possible your save data won't carry over if the digital copy is from a different region, such as Japan, EU, America, and so on.
This is because (Source):
Can DLC for one region be used with the same software title from another region?
DLC will work with games that are released for the same region as the DLC.
You can identify the supported region by checking the game packaging or by going to the game's software menu options, under Software Information and then Support Information.
While this applies only to DLC, it's possible it extends to save data as well.