Roland Anthony Young allowed himself a slight smile yesterday as he pushed through the swinging gate in the high-ceilinged federal courtroom in Alexandria, headed for the door and freedom.

The next moment, the 19-year-old was back before the bench, his smile gone, as U.S. District Court Judge Albert V. Bryan Jr. corrected a little error -- he had suspended Young's sentence, mistaking Young for another prisoner.

As Young left the courtroom through an inside door, escorted this time by U.S. marshals instead of his family, he pounded his fists in frustration.

Court officials said later it was apparently the first time any such mishap had occurred in front of Bryand or his colleague, Judge Oren R. Lewis. Bryan declined to comment.

Young had pleaded guilty to taking part in an Alexandria bank robbery last October and received a suspended one-year sentence when Bryan said from the bench, ". . . and stay away from Roosevelt Island."

Assistant U.S. Attorney Frances M. Green jumped to her feet. "Your honor," she said, "this was the case of Anthony Roland Young, not Bobby R. Mason," who was about to be sentenced in a case involving a robbery on the island in the Potomac.

Bryan, 53, blanched. Young stopped in his tracks. There was silence in the second-floor courtroom, and then snickers from some spectators.

Bryan hastily looked at the folder in front of him, which he said indeed belonged to Mason. The judge, regarded by many lawyers as scrupulously fair but with what one lawyer called "ice water in his veins" on sentencing, ordered Young back in front of him.

"I vacate that sentence," Bryan said. Then, with the correct file in front of him, he sentenced Young to three years in prison, suspending all but six months of it, which means Young must now spend six months in jail.

Young's case had originally been scheduled to follow Mason's case on the docket, but when Mason was late for his court appearance, Young was sentenced first, observers said, trying to explain the confusion.

Later in the day, Mason, also 19, received the one-year suspended sentence under the Youth Corrections Act.

Young could have received five years in prison and $2,500 fine.

Bryan was appointed to the federal court bench in 1971 by then president Richard M. Nixon. He formerly served as a Fairfax County Circuit Court judge, and is the son of Albert V. Bryan, who served in the same federal court before being appointed to the 4th U.S. Circuit Court of Appeals in Richmond.