I still don't get when I win or lose at Caravan [duplicate]

Caravan is probably the most glitchy part of Fallout: New Vegas. I've also run into the same issues as you - there are several instances where the rules as explained don't seem to apply to the game as it is played. In addition to the glitches you mentioned, I also saw cases where it was clear that I'd won, but the game wouldn't acknowledge this, and I had to keep playing until the NPC had won instead.

I went so far as to write my own mod which makes No-Bark Noonan's deck completely unwinnable, so that I could get the last few achievements tied to playing Caravan.

I'm not aware of any tricks, mods, console commands, etc that "fix" the game so that it is played as intended.