I know making sense of the show is a fool’s errand but do you think it’s possible the Lannisters got surprised because the dothraki came out of the Kingswood? Looking at the map it seems like the only route that makes sense for there to be some surprise. Going right under KL would probably quicker but the whole city would be alerted. Going north of the city means crossing the Blackwater which makes surprise impossible.