Disallow Hero? i cant figure it out

How i can disallow hero for Team1…

Example Team1 is Picking ana, i want disallow hero moira and zen for Team 1,
if Team 1 is Picking moira i want disallow hero ana and zen,
if Team 1 is Picking zen i want disallow hero ana and moira

rule ongoing each player

condition:
- has spawned(event player) == true
- hero of(event player) == hero(ana)

action:
- set player allowed heroes(all players(team of(event player)), remove from array(allowed heroes(event player), append to array(hero(moira), hero(zenyatta))))

And 2 more similar rules where you switch the heroes around.

And how i can switch to zen or Moira if im dying with ana ? for example

rule player died

condition:
- hero of(event player) == hero(ana)

action:
- set player allowed heroes(all players(team of(event player)), append to array(append to array(allowed heroes(event player), hero(moira)), hero(zenyatta)))

I tested it one evening with Friends, we have some Troubles About sometimes Hero are removed from the list. Reinhardt Zarya Dva Lucio Brig, doesnt matter which hero, did you Maybe can help here to Shanalotte ?

It Happening after ana / zen or moira die, sometimes

Stupid Question Maybe, is it possible to go for Global or Player Variables here to lock or unlock the Heros ?

I have seen similar reports in the forum, so I come to think that this might be a bug of the allowed heroes actions.

Sure, you set the variable initially to “allowed heroes” and then you simply replace the “allowed heroes(event player)” with this variable in the rules above.

Like that ?
Before:

action:
{
	Set Player Allowed Heroes(All Players(Team Of(Event Player)), Remove From Array(Allowed Heroes(Event Player), Append To Array(Hero(
		Ana), Hero(Zenyatta))));
}

After:

action:
{
	Set Player Allowed Heroes(All Players(Team Of(Event Player)), Remove From Array(Global Variable(A), Append To Array(Hero(Ana),
		Hero(Zenyatta))));
}

Yes, but dont forget to use this action: set global variable(A, allowed heroes(all players(all teams))) at the beginning of the match.