I just checked and as I suspected, now that the sale is over and the demo is back on the page, clicking the download button at the top of the page shows the demo instead of the full game.
I also found another free sale that when you claim it gives the full game even though there's a demo on the page: https://fuzzystudios.itch.io/undercroft-warriors
That game page has something in common with the other one which gave the full game when claiming (even though there was a demo). It also has a separate download button just for the demo.
I think that makes it conclusive. The price tiers I mentioned must be per download button. At least there's no other cause I can think of which would make sense.
So it would seem that the workaround to have a demo on the same page as the full game, and yet allow the full game to be permanently claimed for free, is to set it up so the demo itself has a separate download button just for the demo. Then there's only one "price tier" for the full game's download button, so claiming would give the full game forever because only the full game is tied to that button.
So basically, finding a way to have a second download button just for the demo should be a permanent fix. And I think it would work retroactively for anyone who claimed it during the free sale, as long as the demo is moved to a second download button, and the full game is kept as the first download button (because that's the button people used to claim it). I hope that last part made sense.