As others have said, the rule is you can't end YOUR turn in another's space. This seems to be a legacy of 3e/4e square-centric combat.
That's not true. The rule is that you can't end your move in another creature's space, it doesn't say turn IIRC. According to Jeremy Clarkson, the intent of the rule is that you can't choose to end any part of your move in another creature's space. https://www.sageadvice.eu/2015/09/17/attack-in-an-ally-occupied-space/
I don't really get the idea behind the 'let them ignore positioning' responses; the reason to use a battle map is so that you can track position. If the positioning of characters doesn't actually matter, why not resolve combat with TOTM and save the trouble of setting up maps and miniatures? What makes this fight interesting is that the characters are in a confined space and have to avoid the hazard of being engulfed, the more you softball that aspect of the fight the less memorable the fight becomes and the more it feels like just fighting a gelatinous cube on an open field. (Which is a pretty boring encounter).
IMO it's especially silly and pointless if you rule that a character trapped at the end of a hall 'teleports' to the nearest unoccupied space and ends up on the other side of the cube without any side effect (which is an actual suggestion) if there's nowhere for them to dodge to. I really have to wonder why you'd bother to set up a hall-blocking cube if you're not going to treat it as blocking the hall at all.