The issue is seen when you have multiple resource loaders configured and and template can be loaded by a higher priority resource loader.
The resource is loaded by loadResource but it is never added to the globalCache (see ResourceManagerImpl.java).
For example if (see ResourceLoader.java):
modificationCheckInterval = 60
isCachingOn = true
When a change is detected by a higher priority resource loader it is loaded correctly the next time resource.requiresChecking() is true but it is never added to the globalCache or the existing entry in the cache is not evicted this causes the next request to use the resource from the cache which contains the template from a lower priority resource loader.
The expected result would be that the higher priority template is added to the globalCache and is used in subsequent requests.