I concur with the previous responses. This is very common, more with some species than others, when introduced to a new tank. I have seen it when moving a species I have had for months to a different tank.
Tyyrlym is also correct, some species do this regularly or at certain times of the day. My trio of C. panda are fine during the morning, but in the afternoon and evening frequently (almost regularly) together or sometimes just two or singly, up and down the glass. They have been in this tank for over a year now.
And on the shoaling aspect, I recommend a minimum 3 of the same species where there is more than one species in a tank. A group of 6 or more is always beneficial, the more the merrier (for them and the aquarist
) and if you want two or more species, try to have 3 or more of each species. Some are almost solely species-interactive, others vary. My C. panda and C. similis are almost always together in their own species, whereas C. duplicareus mix with others individually even though there are five of them. In their habitat, more than one species of Corydoras is frequently encountered together, but in very large groups of sometimes hundreds of fish of each species.