Things you are going to reference later
There may be others, but this is probably the most crucial one you should take care with. For a simple example: if a character has pink hair, either mention it early on, or not at all. If you mention it only in the second half of your story, the reader will already have formed a mental image of the character, and they will be forced to adjust it.
This may seem like a silly technical detail, but it holds equally for more important things like character traits. For instance, whether your character has a potentially violent temper, or a strong sense of identity. If you leave such details open to interpretation, and then have them start a fight, or behave like a total walkover, it can be very jarring. If you've allowed the reader to fill in the details for themselves, you can't take that privilege away in the second half.
This is a big part of the work of writing. You have to keep track of the details. This goes both ways: if you make the choice to give a character pink hair, you have to mention it early on, and keep track of it. Equally, if you don't mention the character's hair color, you have to keep track of that as well, and make sure never to refer to it.
In short, you can leave things to the imagination, but it won't make your life easier. You have to keep track of those things as much as the things you explicitly stated. Ambiguity can be even harder work, since the story needs to work with whatever the reader chooses to imagine.
Ambiguous endings You might think your example is different, since it concerns the ending, but it's much the same principle. A satisfying ending needs to be set up. Don't leave the impression that you're going to wrap everything up neatly when you're going to leave it all for the reader to figure out.
In short, you need to keep track of what your story is promising and make sure that you pay that off.
Breaking the rules Of course, all rules can be broken, and this is no exception. You could have a character that is very sweet and timid, and have them suddenly go on a violent rampage. It'll be jarring, but it can be jarring a good right way. You could write a detective story that sets up a neat conclusion, and then have it go completely off the rails, because the detective can't solve it.
The only thing to keep in mind, is that it's never less work for you. If you do this kind of bait and switch, you need to be doubly aware of what the reader is feeling, imagining and expecting. It's always more to keep track of, even if the amount of detail going into the actual text is less.