Usually an oath taken before the three major surrenders east of the Mississippi would invalidate a claim for pension relief. Ordinarily an able-bodied soldier found behind Federal line was taken to prison unless an officer was absolutely convinced he was a deserter. If so, he could take the oath of allegiance and remain north of the Ohio River.
What Confederate command disbanded the night before the surrender, and which surrender are we talking about?