The wizard would argue that he would incant his spell before coming into view and then immediately cast it once he moved and had LOS, surprising them. Mind you, he has argued that the number 0 is an even number before, so I generally take him with a pinch of salt
A few points under 5e...
The gm determines when there is surprise when two groups encounter.
If therevis no stealth or hiding involved, there is no surprise.
Hidden is not just unseen, but also unheard - and hidden requires a hide action.
Spells can be ready and used as reactions to triggers for one round.
The spell is cast during your turn (materials, components, slots, etc then) and the effect held by concentrstion wsiting for a trigger but it goes away at the start of your next turn.
So the only way for casting a spell and ready it then move in and release is even,posdibly a surprise is is the point of casting did not in itself give up the ghost. Verbal components, not taking hide action (action) while casting **and** approaching, within a normal 30' move (assumption) to get to line of sight etc etc etc - barring exceptional circumstances its hard to,imagine that not being a noticeable thing.
Obviously details matter.
Was it a spell without verbals or that was metamagic subtle? That can avoid having the cast-to-ready noise tip them off.
Is the caster a rogue able to use hide as a bonus action? Then they could use the ready action to cast and hold *plus* use hide as they walk up to get line of sight to keep from being heard as they walk to the corner/door.
Otherwise, the cast as ready and approach is rarely going to be quiet and unnoticed as they walk up to the door - thats a no stealth on approach encounter start.
That said, cast and ready two step at a corner is very useful for a number of reasons - not the least of which is preventing counterspell if your "cast" is done around the corner.