Certain objects which are on the map by default, I'll list a few examples:
Land_BC_Basket_F
Land_BC_Court_F
will not return any object ID if they're being looked for by
nearEntities
nearestBuilding
nearestObject
nearestObjects
nearObjects
If you add them by custom in your own mission, the scripts will ALWAYS return an ID though.
This must mean, that there is some kind of bug or misconfiguration causing, that you won't find the static/default ones.
{F24074}