The problem is this.
The unit being upgraded gets...
1) Created
-->Your onUnitCreated script runs
2) Promotions from old unit copied
So removing it in onUnitCreated does nothing. You can verify this by sweeping the existant promotions on the unit. However...
3) onUnitLost is triggered with old unit.
-->If you remove the promotions here, it should work.
You just have to tag and eliminate extraneous connections and store the id between calls in scriptdata of some object. Remember, when a unit is built, both unitCreate and unitBuilt are called. Promotion only triggers one. Similarly, units lost in battle trigger combatResults before unitLost. If you init units on your own, or barbarian units will trigger create without built, similarly, units destroyed by hand trigger lost without combat, so due diligence is required. You can test that the unit lost can upgrade to the unit created to verify that this was a result of an upgrade, and clear your tracking if any other create/built, etc. event triggers. That should be reliable in 99% of your cases, and probably won't cause any problems in your situation, even when it's wrong.
Alternatively, you can replace the upgrade button with a custom upgrade function, but then you have to decide when to upgrade for the computer.