localc is working as documented (and as it should, and as every spreadsheet has done since the days of Visicalc).
It's a feature, not a bug.
Your formula referred to cell
G$2. You inserted rows which moved
localc updated all references to the old
G$2 to its new location of
G$5, preserving the reference to the same data.
In short: the cell was moved so ALL references to it had to be updated to match its new location.
This needs to happen whether the reference was relative or absolute - the important thing is the data the reference was pointing to.
If it didn't do this, then every time a column or row was inserted or deleted, every formula referring to any cell that got moved as a result of that operation would be broken because it would be pointing to the wrong data.
The same thing happens when you cut and paste a cell from one location to another - if any formulae refer to it, they are updated to refer to the new location. This allows you to move a cell or multiple cells to a different location on a sheet or even to a completely new sheet.
BTW, if you had inserted rows below
G$2 would not have been moved and there would be no need to update any references to it. This happens frequently when you need to insert a row or rows between two existing rows in a table. Or when you sort the data in a table.