As JJMack pointed out, saving to png automatically merges the layers for that saved file. This lets you keep the layers to save in another format that does support layers like tiff or psd.
Therefore merging then saving to png is duplicating your efforts.
BTW, flattening will remove any transparency, which is why I use the term merge instead of flatten.