It has nothing to do with the drone code.
Before deleting or reinstalling anything, the best way to find out the reason the drone is ascending further than you expect, post your flight data for someone to investigate.
The explanation will be in there somewhere.
To post your flight data there...