I finally understand the ending of Dave.
When we see Libby at the end, it's proof that Dave was right. Hurley really is just fantasizing based on various things he saw in the asylum. Like the numbers. And like, as we see in the end-of-episode plot twist, a fellow inmate.
This wasn't actually supposed to have any significance outside the episode of course. It was just a fun twist. Buffy the Vampire Slayer did the same thing in one episode. Buffy was under some spell that told her she was in an asylum, fantasizing the whole series. The only way out was to kill all her friends. By the end of the episode, she broke the spell, but then we cut to the asylum, revealing there was no spell; she really is fantasizing the whole thing, and now there's no way out.
This failed on Lost because we're so used to seeing characters in one another's past regardless of how little sense it makes. So we didn't say, "Libby the psychologist survivor has the face of some old inmate? Ha! Hilarious! All in Hurley's head! Just not really, cause the creators already debunked that." We said, "Libby was in Hurley's asylum before coming to the island." The creators saw this, respected our respect, didn't want to cheat us more than they already had and tried retconning how Libby might have gone crazy.
The ending would have succeeded if we'd instead seen the entire cast as mental patients, with Jack perhaps as a doctor. Perhaps the creators initially planned on this but don't want to admit it. ABC reportedly objected to Dave because they thought it gave away the series's secret too early.