How long are you waiting before takeoff?
It's normal for the drone to restart during a firmware upgrade. Did the drone switch off and stay off, or did it restart itself and remain on? Did you see a message stating that the update was done?
No matter what you did to that gimbal you need to recalibrate the gimbal and it is working only with a specific tool that DJI uses it. Python will not do it
.