Looks like the reason was that I used Preact components in a loop. Making the container a Preact component as well works fine. So it's at least not nearly as severely broken
Preact hydration on Astro 5 Beta seems to be broken as well (just like Solid). It worked with a simple component, but it doesn't like something about a more complex one.