More than 19 subplots vertically- Subplots get corrupted

Hello! There is an issue when using subplot in R. When more than 19 subplots are plotted vertically with common x axis the plots get mixed and the second plot from the end gets all the space in the layout. Is this a bug? Thank you!