It is due to the way PS flattens an image; by default it (sometimes?) preserves the layer masks; and the underlying layer's mask will mask the layer above. If you attempt to merge/flatten only two layers PS will pop up a warning about this; and it gives you an option of applying the mask of the underlying layer before merging. You do not get the option when you export, flatten a group of layers, or flatten the entire layer stack.
The behavior also seems to be dependent on what is being flattened/merged e.g. adjustment/vector layers vs image layers (or if an image layer is included). I can't really say for certain exactly when it will/won't happen.
In your case, it appears that the layer "1"s mask is masking some/all of the edits above it...
The way I have found to get around it is to create a new top layer and then merge visible into it (shift-opt-cmd-E). This copies the current view as a new image on top of all other layers; then turn off all other layers below before exporting/flattening (alt/option click on the top layer's view (eye) button). Your result should then be what you were expecting.