From your answers, it sounds like you're basically doing fine. I'll confess I have a certain kneejerk assumption about situations like these, which you may have read between the lines of my questions. That doesn't seem to apply here. Getting caught off guard and getting your wires crossed is okay. It happens. It probably won't be the last time.
I don't think it's necessary to take drastic action quite yet. If the trend has only gone on for two sessions, and the first of those was a situation where they knew they were going in over their heads and explicitly chose to do so anyway for personal reasons (that's fine. That's great. It's roleplaying), then it's barely a trend yet. What you might want to do is make clear that this situation isn't a precedent and acting recklessly is usually a bad idea.
How I would go about that is starting a little softer. Just bring it up, verbally, in the game. For example, maybe the characters hear rumors of their exploits in that enemy fortress and about how much of a screw-up on the defenders' side it is considered. They learn that it is absolutely not standard, and that ordinarily one should expect much stronger defenses. Maybe whoever you decide was responsible for it got dishonorably discharged, punished, reassigned etc., you might even work that into the plot somehow. Maybe this quest you have an excuse to send the characters on is a mission to do something at a similar fortress (probably not exactly alike - that would be a little lazy, and suspicious), since the characters have clearly already done fine once, and they have an opportunity to see how it's supposed to work.
So long as you do something like that, making sure that this isolated incident doesn't teach them it's safe to be reckless, I think you should be fine just carrying on as you have until now. Don't let up, but don't go out of your way to put on the pressure just to teach them a lesson. That rarely ends well.
If you feel adventurous, you could try taking this somewhere and thinking about weaknesses in enemy defenses or situations where it might be advantageous to act boldly (if not stupidly). Assume there's an in-world reason the defenders reacted like they did, and figure it out. If the players can learn or guess where enemy defenses are weak, subject to a quick smash and grab, or can be bluffed, and manage to get away with it in the face of superior force, I predict they'll feel great about it. Like they cheated. And if you planned for it, even just as a side note in your preparations, it doesn't break your game.
The fundamental element behind all of this, I think, is the logical consistency of your game. You justifiably want to preserve logical consistency by noting that superior enemies remain superior enemies, and that attacking without a plan is the kind of thing that gets combatants killed. That logical consistency has been damaged, but I don't think it's broken yet. If you can take the reins and make it so that the inconsistency retroactively wasn't inconsistent after all, you can salvage the situation and even make it work for you.
(What if all of this fancy rubbish doesn't work after all? In that case, my honest opinion would be it's probably time to communicate out of character about how you made a mistake, and make sure everyone is on the same page about what the game is like and should be like. I shy away from trying to solve what is probably a meta-game problem within the game.)
This last thing is somewhat tangential to the rest of the topic, and more general:
10-no. Do you think it's a good idea to be explicit about this?
Yes. Absolutely. This also applies to any sort of in-game information management for adventures. Subtlety is the enemy of understanding. If there's something you
need the players to understand, be explicit about it. This (probably?) isn't the case here, which is why I'm putting this apart from the rest of the post, but it sucks to find out several sessions in that you and the players fundamentally disagree on, say, how important a plausible degree of caution is, and more importantly
should be. This is, incidentally, my first assumption in cases like this.
Inside the game, for all I know you already do this so this is essentially unsolicited advice, but if there's information you
need the players to know, don't be subtle. Club them over the head with it if you have to. Don't leave it to chance. Even if something is obvious to you, that doesn't necessarily mean it's obvious to the players. It's perfectly okay to decide a given piece of information is optional and the PCs can miss it, but if them not knowing would break the adventure, they have to know. If you have a murder mystery planned, then the players need to know there's a body, where they can start looking, and why they should should care who done it. Just putting a grieving widow in a scene runs the risk of the players not thinking to ask her what's wrong. In terms of letting the players know when they're in over their heads, or giving them the opportunity to know, it sounds like you already practice this, so that's fine.