This is the origin of some confusion later ...
This function returns false if it is a custom metadata.

You need to either change the function name (isNotCustomMetadata) or change the implementation.