Thanks just solved it with the help of the comments to my question.
The problem was that on some occasions the file was not writing to disk due to nil values.
If there are any keys in the dictionary that refer to nil items then the dictionary will not write to file. Resolved the issue by checking if each object that I want to include in the dictionary is nil or not, and if it is nil then I omit that from the dictionary to ensure it writes to file.
For example
NSDictionary *dictionaryItems = {@"key1":nil,@"key2":@"string object"};
BOOL didItWrite = [dictionaryItems writeToURL:dictURL atomically:YES];
//didItWrite will return NO in this case since we have a nil object in the dictionary
NSDictionary *dictionaryItems = {@"key1":dataobj,@"key2":@"string object"};
BOOL didItWrite = [dictionaryItems writeToURL:dictURL atomically:YES];
//didItWrite will return YES here since there are no objects that evaluate to nil in the dictionary.
Quoting @GuyKogus in the question comments:
The reason why that happens is that you're really [NSDictionary dictionaryWithObjectsAndKeys:]. You'll find in the documentation that it takes as a parameter a null-terminated list of alternating values and keys. So the moment a value in your list is nil, it ignores the rest of the parameters.