You are trying to use wrong tool for updating your GeoPackage. It is undefined what your ogr2ogr command does and it is not worth further investigations. It is just wrong tool.
Use ogrinfo instead. It works for me with GDAL 3.2 and with the following command.
I made this GeoPackage to start with:
ogrinfo polygon.gpkg -al
INFO: Open of `polygon.gpkg'
using driver `GPKG' successful.
Layer name: polygon
Metadata:
DBF_DATE_LAST_UPDATE=2020-11-06
Geometry: Polygon
Feature Count: 1
Extent: (665.000000, 155.000000) - (946.000000, 372.000000)
Layer SRS WKT:
(unknown)
FID Column = fid
Geometry Column = geom
OGRFeature(polygon):0
POLYGON ((665 294,817 372,946 155,665 294))
Notice that the geometry type is Polygon. ST_Buffer function creates polygons as well so there will me no problem in updating the geometries. If I had geometry type Point then triggers would prevent the insertion of polygons into that table.
Then I run ogrinfo command with SQL dialect "indirect_SQLite" in order to get the SpatiaLite functions. Otherwise GDAL is running commands directly against GeoPackage with the standard functions without loading the mod_spatialite extension. In that case ST_Buffer is not found and GDAL errors out.
ogrinfo -dialect indirect_sqlite -sql "update polygon set geom=ST_Buffer(geom,10)" polygon.gpkg
The geometry of the only feature in the GeoPackage has been changed.
OGRFeature(polygon):0
POLYGON ((660.566182558625 285.036671215639,660.101288123696 285.2820517349,659.649930712494 285.551523295949,659.213357599026 285.844341245292,658.792775202....
ogrinfo -sql "select spatialite_version()" test.gpkg -dialect sqlite
? I need to use-dialect indirect_sqlite
.Geometry:
. See the report in my answer as an example.ogrinfo test.gpkg -sql "select ST_Buffer(geom,100000) from test
.