Yeah, I know that’s how it’s explained, but… why though? Why would fighting in one battle fulfill their oaths? Presumably, Isuldur wanted them to fight for the whole war, that’s how conscription usually works. So I don’t see why one battle would do it, especially since as undead they have nothing to lose.
It isn’t stated that they knew it was closed when they arrived. They might have figured it out after the fact.