No it is not a mistake. The a’ sign has to be read together with another a’:
Together the whole thing means choosing the a' that maximizes Q(s'^{(1)}, a'). At the time we compute y^{(1)}, we are only at the stage trying to determine what the best a' should be. Therefore, we use a' there to represent that it is any value of a that maximizes the Q.