I was able to reproduce this issue with larger images. Steps to reproduce this issue
Data is Attached byte4800.tif
gdal_translate -outsize 9999 10118 byte4800.tif byteError.tif
gdal_translate -of GPKG byteError.tif Test.gpkg -co TILING_SCHEME=GoogleMapsCompatible
Error
ERROR 1: sqlite3_exec(UPDATE partial_tiles SET zoom_level = -21, partial_flag =
0 WHERE zoom_level = 20 AND partial_flag != 0) failed: columns zoom_level, tile_
column, tile_row are not unique
ERROR 1: sqlite3_exec(UPDATE partial_tiles SET zoom_level = -21, partial_flag =
0 WHERE zoom_level = 20 AND partial_flag != 0) failed: database disk image is ma
lformed