I'm not sure if I understand you right, but anyway, I actually had a nasty bug due to what I think you are talking about.
Anyway, if you delete an ability, units with that ability still have the ID for that ability in their list. If you add a new ability and it happens to reuse that ID, the units with it in their list will gain this ability.
It works the same for buffs, I think. I'm not sure if this is your problem or not.
If it is happening only in-game, I don't know what the problem could be then. Might be some bad triggers or something.