Something's wrong. House can't win almost 2/3 of the time if it has 0% edge. It would mean that it is possible for the house to lose 2/3 time with 0% player edge. Something like that would be exploited by now.
You're correct, something's wrong. But what is it?
Something in the code. I'm reviewing it right now, gut feeling is something like the way those variables are incremented inside those while loops. If the code is OK (which I doubt), then we stumbled onto something very interesting.