Usually any "gap below flashing" is meant to be left open for moisture to drain out. I'm not sure if this was the case in the picture your provided because like others, I wasn't quite sure what I was looking at. Since you already filled it, I would continue to monitor the area below for stucco peeling or flaking off due to trapped moisture so that you can open it back up if needed before the damage gets too extensive.
Was it causing issues before you filled it in?