Too many/wrong fish for your tank size I think. In a 40" tank and choosing from your list I would do a species tank of the yellow labs because they are small and peaceful enough for a tank that is less than 48" long.
If you wanted 1m:4f each of peacocks, fryeri, labs and cobalts, I would keep them in a tank that is 48" long by 18" from front to back at minimum.
Malawi do not pair so if you are keeping more than one/species you want 1m:4f to manage aggression. Keeping them in this type of grouping will help the fish feel comfortable and be out and about more.
The water quality is not the concern with the size/length of the tank, it is aggression. Hiding is a sign, even if you don't witness behavior that looks aggressive. Your fish are afraid.