This problem could be caused by over discharging the battery causing a reversed voltage on one or more of the cells.
A 12V lead-acid battery will consist of 6 cells in series. Ideally they would all have the same characteristics but in practice they will all have different capacities and the differences tend to increase with the age of the battery.
During discharge the same current flows through each cell and the voltage across each cell will gradually reduce as the cell discharges. The weaker cells with less capacity will discharge (possibly to zero volts) before the stronger ones.
If discharge continues beyond the point where a cell has zero volts the weaker cells will continue their voltage decline with the stronger cells providing the current until the voltage across them goes negative and they start charging in the reverse direction. This voltage reversal can cause permanent changes to the cell and also cause the same effects as with charging. If the voltage increases enough electrolysis can occur that results in gas generation. (In Li-Ion cells it can cause plating of the copper resulting in dendrites that short the cell).
Lead-acid batteries normally do not have individual cell monitoring and protection that are required with Li-Ion batteries so this cell reversal can occur if the total voltage across the battery drops to less than about 10.5V. This value is enough to guarantee that the worst case is a single cell at zero volt and five cells at 2.1V.
The situation is more complicated when under load as the terminal voltage will also be reduced because of the cell internal resistance, since the internal resistance of a cell increases at a low state of charge the weak cell is impacted even more and will drop its individual terminal voltage more than the others.
Here is an example 6V battery where the load has reduced the terminal voltage to 3V. In this case top and bottom "strong" cells still have 2V on their terminals but the centre "weak" cell has discharged to the point that the cell voltage has reversed and it has negative 1V at its terminal. This can cause effects that you have noticed or damage the cell permanently with some chemistries, particularly with Li-Ion.

simulate this circuit – Schematic created using CircuitLab