Virtual Box 'VERR_SSM_LOAD_CONFIG_MISMATCH' error when restoring a snapshot

Since I had a hard time finding an answer online, I decided to make a question here, and answer it myself, so maybe it helps someone:

I have a VirtualBox 6.1 installed on Windows 10, trying to run Centos7.

When I tried to start a VM, I got an error saying something like "Fatal! Could not read from the boot medium".

Then, I powered off the machine, and ticked the checkbox to restore most recent snapshot.

Restoring failed with following error text VERR_SSM_LOAD_CONFIG_MISMATCH :

Failed to open a session for the virtual machine CentOS7 - plus Liferay7- Template.

ahci#0: The target VM is missing a device on port 0. 
Please make sure the source and target VMs have compatible storage configurations 
[ver=9 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH).

Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

For me I just deleted the saved state and then it loaded without a problem on the next boot.