If you change the prototype trigger key (expression), on next discovery Zabbix will leave an old trigger with the same key (expression) and create a new one besides it.
To reproduce this bug:
- create a prototype trigger which uses one key as a trigger expression
- wait for the discovery to execute to create this trigger on a host
- once the trigger is created, edit the prototype trigger and choose a different key in the trigger expression, but leave everything else the same
- wait for the discovery to execute again and you will see that the host now has two triggers with the same name, but with different trigger expressions.
I haven't tried if this happens only of I change the trigger function and not the key.