The default method of generating a .mbtiles database in QGIS (generate XYZ tiles) is showing gaps at certain zoom levels. Thankfully the QMetaTiles plugin seems to produce a working database for an offline mapping code. I’m using a historical map supplied as a JPEG rather than another tile source so never come across this issue before.