What's in a name? Need help with weirdness

I know there’s a logical explanation but for now this seems pretty weird to me.

My script reads file type, bit depth and resolution of scanned files and has done so without difficulty for years until this. Now I’m on Mojave. I want to emphasize that I’m talking about one and the same file, I’m only changing it’s name:

If I name the file “TEST scan.jpg” properties disappear! Name it “TESTscan.jpg” or “TEST scam.jpg” or “Bob’s yer uncle.jpg” and the properties return. Change it back to “TEST scan.jpg” and they’re gone:

As “TEST scam.jpg” (all properties have values):
{color space:RGB, image file:file “LK’s MacBook 2TB:Users:lk:Originals:Test scam.jpg” of application “Image Events”, bit depth:millions of colors, dimensions:{2550, 3300}, location:folder “LK’s MacBook 2TB:Users:lk:OCR:Originals:” of application “Image Events”, embedded profile:profile “SyncMaster” of image “Test scam.jpg” of application “Image Events”, file type:JPEG, class:image, name:“Test scam.jpg”, resolution:{300.0, 300.0}}

As “TEST scan.jpg” (values are missing):
{color space:missing value, image file:file “LK’s MacBook 2TB:Users:lk:Originals:Test scan.jpg” of application “Image Events”, bit depth:missing value, dimensions:{}, location:folder “LK’s MacBook 2TB:Users:lk:OCR:Originals:” of application “Image Events”, embedded profile:missing value, file type:missing value, class:image, name:“TEST scan.jpg”, resolution:{}}

Is this name somehow reserved? Anyone else find this weird?

Thanks for your help.

I renamed a test JPEG file to “TEST scan.jpg”. I then ran the following script on the test file:

set thisFile to choose file

tell application "Image Events"
	launch
	set thisImage to open thisFile
	set the propertiesRecord to the properties of thisImage
	close thisImage
end tell

propertiesRecord

The script returned:

{color space:RGB, image file:file “Samsung SSD:Working:TEST scan.jpg” of application “Image Events”, bit depth:millions of colors, dimensions:{4032, 2268}, location:folder “Samsung SSD:Working:” of application “Image Events”, embedded profile:profile “sRGB IEC61966-2.1” of image “TEST scan.jpg” of application “Image Events”, file type:JPEG, class:image, name:“TEST scan.jpg”, resolution:{72.0, 72.0}}

There could be many explanations for the results the OP is seeing but the file name doesn’t appear to be one of them.