Yes, sorry I was wrong talking about averaging instead of median.
Lets see what happens in median filtering.
Suppose that your filtering routine goes on image from TOP lines down, line after line.
Suppose also that it goes in every line from left to the right.
You can define it to go in any order, it will not change that point that I try to explain here.
In such walk it creates new picture, pixel by pixel that come from median 3 on 3.
1) When we do first median filtering, pixel that is located in first line from above, can travel to second line (in resulting image) and not to third (since meadian 3 on 3 can only "push" pixes for distance of one).
2) When we do second median filtering, this pixel can travel one more step down - to third line.
But what with travel distance for pixel that will want to move UP in lines?
For example at the beginig this pixel is in fifth line.
This distance for this pixel is only 1 and not more, since out routine goes from top to bottom in lines.
And this is just property of algorithm.
Now, you will want to use bigger median mask. Such mask will give you longer bottom to top traveling distance from bottom up, not 1!
This will bring pixels to places, where they can not to be moved using 3 on 3 medians, as we did in first case! And this means that does not matter what size of median you take, such problem will present.
You can define any order of work for your median routine, problem will present but with different directions (up-down-left-right).
MAIN LINE: Its impossible to do same work with larger median mask, since it will give to pixels more fredom to move, then they have when two subsequent median filters of 3 on 3 are applied.
Well, I hope I was clear enough. Just a direction to think about it.
Problem can be that my solution is not really connected to image processind and more to some procedural features of algorithm.