SANTA MONICA, Calif. — Stephen Miller had their attention. That was reason enough to keep going.

Standing behind the microphone before a hostile amphitheater crowd, Mr. Miller — then a 16-year-old candidate for a student government post, now a 32-year-old senior policy adviser to President Trump — steered quickly into an unlikely campaign plank: ensuring that the janitorial staff was really earning its money.

“Am I the only one,” he asked, “who is sick and tired of being told to pick up my trash when we have plenty of janitors who are paid to do it for us?”

It appeared he was. Boos consumed the grounds of the left-leaning Santa Monica High School campus. Mr. Miller was forcibly escorted from the lectern, shouting inaudibly as he was tugged away.

But offstage, any anger seemed to fade instantly. Students were uncertain whether Mr. Miller had even meant the remarks sincerely. Those who encountered him afterward recalled a tranquillity, and a smile. If he had just lost the election — and he had, the math soon confirmed — he did not seem to feel like it.