Glad the guess has led to a solution!
As to your question ... how could I possibly know why it happened?? Don't run that combo of web on linux and M$ on DB backend. That would involve networking so there could have been a network issue or a time out or a 'who knows'.
Do know one of the last things moodle code does is to check/re-set basic settings for everything in moodle. Long pause there.
Do have suggestion now that you have a dev ... do the update/upgrades from dev site first (after dev site backup) and ... and ... use the upgrade.php script from command line in code/admin/cli/ ... takes web service out of the loop and is just php talking to the DB ... faster ... and errors will show there.
'SoS', Ken