Find the BIOS setting i mentioned earlier and turn off Hot-swap for the SATA ports. According to MSI the setting is the same on the B350 and X370 'Krait' borads. [Pg46 of the manual].
Sometimes Windows will just decide to do that. It is possible to fix with a registry key, from the instructions on this page. However I followed those instructions to stop my NVMe drive from showing up as removable (no windows stahp). The instructions worked, but instead all of my other drives showed up as removable when they hdn't been before. I couldn't be arsed to fix that so they're still there.