Thanks Brenden, I have upgraded to the latest hotfix and the issue still occurs. After a bit more testing I have found that it only happens if when creating the class, I create the GUID field with a field type of 'Primary Key' instead of 'Standard field'.