KML to Shapefile is one of the most common conversions there is, usually because somebody sent a KMZ from Google Earth or a field app and the next tool wants a Shapefile. The shapes almost always survive. The attributes are where it goes wrong, and it happens on both sides.

On the KML side

KML keeps attributes in a schema, but GDAL only links that schema to the layer through values. If no feature in a layer has a value in any field, none of the fields come back when you read the file. One value in one feature is enough to bring them all back. So a layer of empty fields simply has no fields after the round trip.

Some names are taken by the reader itself. It adds its own fields to every layer, and a source field called timestamp, begin, end or visibility comes back empty even though its values are in the file. A field called name becomes the placemark label and comes back as Name.

Types change when the file is read. A 64-bit integer field with 220 comes back as the text '220'. A trailing space in a text value is written to the file and gone when it is read back.

On the Shapefile side

A field name holds 10 bytes, not 10 characters. For Latin names that is the same. A Polish name like Ulica_główna is cut in the middle of a letter and ends with a broken byte. When two long names become the same after the cut, the second gets a number at the end, and most tools do not tell you which column is which.

A text value holds 254 bytes, which is 127 Cyrillic letters or 84 Chinese ones. Written without an encoding, non-Latin text turns into question marks and there is no .cpg file next to the .shp.

What to check

  1. The field list before and after: names, count, types.
  2. A few long or non-Latin text values.
  3. That the .cpg file is there if your text is not plain Latin.
  4. If the fields are empty on purpose, that they came through at all.

If the next tool accepts GeoPackage, use it instead of Shapefile: none of the Shapefile limits apply. Swage names all of these before writing and checks the result against the source: https://tryswage.com/kmz-to-shp.html

Each case has a small script here: https://github.com/swagetool/format-notes