I have a layer with lines - I export it qith QGIS to a new geopackage. A second layer with the same table structure but containing polygons should go into the same geopackage and preferably into the same layer. When i go on Export, select the geopackage and type in the same layer name as before, it asks me if i want to: Overwrite File, Overwrite Layer, Append to Layer or Cancel. I pick "Append to layer" but the result does not contain the polygons. Am i doing something wrong or is this a bug?
Depend on what your future use is but mixing geometry is generally not good practice (for exemple QGIS and Arcmap cant use layer with mixed geometry).
For your specific problem I think it came from the type of geometry of your line layer, when you export it you have the option to choose the geometry type (Automatic, Point, Linestring, polygon, GeometryCollection or No Geometry), if you let it as Automatic (the default) or choose linestring it is set as linestring and you cant add another type of geometry.
You should try to export again your line layer with the Geometry type : GeometryCollection then try to add your polygon.