Cosmogrand Zenith’s ability resolves before the spell that caused it to trigger. It resolves even if that spell is countered or otherwise leaves the stack without resolving. Notably, if your second spell is a creature spell and you choose the second mode for Cosmogrand Zenith’s ability, the resulting creature from that spell won’t get a +1/+1 counter.