"Her fourth daughter, the Grand Duchess Anastasia Nicholaevna, was born at Peterhof on June 18th, 1901. However well the Emperor might hide his feelings, the Empress knew how intensely he longed for a son. He never showed any visible regret when the sex of his successive babies was announced. When the Grand Duchess Marie was born, it was noticed that he set off on a long solitary walk, but that he came back as outwardly unruffled as ever. In the upper classes of the country, however, there was much disappointment at the births of so many daughters. " - Sophie Buxhoeveden.
So it seems to me that the walk was after Maria was born. When you think about it, Anastasia was born very early in the morning, and Nicolas was with her and Alix, as he himself wrote: ". Everything went off splendidly, quite quickly and thank God without complications! Thanks to the fact that it all began and ended while everyone was still asleep, we both had a feeling of calm and solitude! "
It also always puzzled me, that Nicolas, who always wrote how much the newborn baby wieghted and measured, never wrote such a thing about Maria!