Restart device and update existing python file in RPi

The inconsistent state is related to a failed update-module update.

I’m going to need a little more information on what exactly you are trying to do?

Is this from the script update-module?