Recharts bar chart y-axis range not rendered in case of multiple bar charts on same page

I am using 4 re-charts barchart control in react to display bar charts in the same page. To set the y-axis range, I am using datamax. It is working for 2 of the barcharts but for the remaining 2, it does not work. Below is the Y-Axis configuration:-

<YAxis type="number" domain={[0, (dataMax) => Number(dataMax) + 50]} />

Below is the screenshot of the way the charts are currently rendered. The ones highlighted in yellow are not correctly rendered.

enter image description here