Unique GUIDs for property groups/types when creating ContentTypes programmatically in v16

In Umbraco 16 do we need to explicitly provide GUIDs for property groups and properties when creating content types programmatically? I believe this wasn’t the case with previous versions and a GUID would be supplied if none was specified.

So, the issue was that the PropertyType constructor given a valid IDataType sets the DataTypeId but not the DataTypeKey. That resulted in a constraint violation and not the actual property’s GUID. Looks like a bug, does anyone know if there’s logic behind this?

Temp solution: Explicitly set the property’s DataTypeKey after creating the PropertyType.