Don't feel bad because stuff like this happens to all of us. One of the best debugging steps you can take when you hit an apparent dead end is to walk away for a while and work on something completely different before coming back for a second look. I'll bet that may be what happened here: you posted the question then came back after a bit and figured out you weren't looking where you thought you were and then everything shook out.
Coming at things with a fresh(er) perspective can help illuminate the blindingly obvious (because when you're heads down it's easy for the obvious to not be so obvious because your focus is too sharp elsewhere).
The cake is a lie.
The cake is a lie.
The cake is a lie.