There are two different things that have to be considered here. First, there is a specific robot that the team has to announce that plays the role of the goal keeper. This and only this robot has special protection in the goal area. If this robot suffers from a penalty, it still remains to be the goal keeper, even if it was taken out. After 30 seconds, it can re-enter from the touch line and walk back into the goal area. In the meantime, another robot can walk in the goal area and protect the goal, but it does not automatically become the goal keeper. So it is allowed in the goal area because no other robot is there at the same time, but without any special protection. If you want this robot to become the permanent goal keeper with special protection, this has to be announced by the team to the referee.
Does that answer your question?