Leash holder UUID is unchecked during NBT deserialization
When running the following command (or a similar command with a UUID that is not a valid integer array), an exception will be thrown and an "Unable to summon entity" error will be sent:
/summon minecraft:cow ~ ~ ~ {leash: {UUID: 1}}
This is equivalent to the following spawn egg, which fails to spawn a cow and prints an exception to the log:
/give @s minecraft:cow_spawn_egg[minecraft:entity_data={id: cow, leash: {UUID: 1}}]
Code analysis (Yarn mappings)
The NbtCompound#containsUuid method validates that a given key has a valid UUID value before the NbtCompound#getUuid method, which throws an exception for invalid UUIDs, is called. In all other cases of NBT deserialization, these methods work in tandem.
However, the Leashable#readLeashDataFromNbt only calls the NbtCompound#getUuid method. Therefore, it will throw an exception for invalid UUIDs.