As adventure design, allowing the characters to take specific actions to improve their chances in the face of a potential ambush (which includes allow the players to state that they are going to be traveling more cautiously) is fine. As advice to the DM, it sounds like it might have been poorly stated, simply because it could encourage the frazzled and inexperienced DM to think in terms of specific conditions that need to be met (your "magic words") instead of a broad question of, "Have the players done anything ahead of time to prepare for the ambush? Consider their preparations when introducing the ambush."
"Magic words" are bad when the DM is looking for something that is more specific than the operating scope of play. I'd say, for most games, saying, "We know there are plans for an ambush, so we are going to be on the lookout" is acceptable, so long as you understand that the players will, of course, say things in their own way. There's nothing wrong with expecting players to be specific, but there is something wrong with allowing things, in general, to be vague, and then adjudicating based on the absence of something specific known only to the DM.
Also, we are talking about a circumstance that would allow the players to gain an advantage, not a circumstance that would doom the players to a disadvantage. That's a big difference. If, as a player, I get ambushed but have a fair shake on my perception vs the stealth of the opponents, I'm not going to complain. I got my normal passive perception for my normal behavior. On the otherhand, if the DM decides that we all get disadvantage because the ambush happened late in the evening and we didn't say we were stopping before nightfall, I'd call foul. "Well, you didn't ask us if we were stopping at nightfall, so why am I getting disadvantage for something that I never consciously did?"
I would be irritated if the DM designed the encounter to punish characters who did not have advantage, unless we were playing in a campaign that was understood to place a lot of emphasis on scouting and preparation.
As far as allowing characters to fail to act on knowledge they (and the players) have, because the players declined to use that knowledge, I think this also comes down to "difficulty" and expectations. If I am playing a low-key beer and bongs campaign, I might not really worry about what the players remember to do because, generally speaking, we are playing on easy level, and PCs are meant to stumble in, kick ass, and stumble on.
That being said, I prefer to expect the players to pay attention. I don't feel that it's my job as a DM to keep track of what the players have learned through their characters. If the players forget to act on information they got at the table, that's on them. This is something that a number of us, as DM's, have communicated at the table at the start of a campaign. One DM liked to include little side-quests, but made it very clear, "If you do not remember who gave you the side quest, you will not be able to collect any reward for it." I like this. I bring a notepad with me to most games and write stuff down. I review that notepad on the train to the next session. It greatly improves my enjoyment of the game. (I actually tape my character sheet into a composition book, so grabbing my character is the same as grabbing my session notes.)
As far as an in-world justification for why a character would fail to act on knowledge that they have. This is in no way "temporary amnesia." As a skilled professional, I am more than capable of learning important information and yet failing to act on that information, and only realizing afterwards that, "oops, oh yeah, I knew that this was happening today, but I forgot to properly prepare for it." Player characters are the same way. They can forget stuff, even if they have a high intelligence.
Of course, again, expected difficulty and the given circumstance will modulate this. If last week, the players learned that the wine at the feast would be deadly poisoned, and this week, an hour later, in-world, they casually mention that they are going to get drunk on wine at the feast, I might help them recall this information. (Probably by just saying, "Really? An hour ago, they just told you that the wine at the feast was poisoned." But, if we're on cruel mode, I might ask them to make an Intelligence save before adjudicating the action, allowing a chance to remember that the wine was poisoned before putting the glass to their lips. And this would be appropriate, because players would know that is the table they are playing at, and I hope we'd only be playing that kind of game with strong player buy-in.)