Post your map, or at least copy the unit and ability, along with the triggers and upgrades into a new map and post it.
Also try storing the player and the unit into an variable before the upgrade is finished, and check if your unit can have the upgrade in object editor.