I can see that happening but not quite under the condition you outline.
URL() needs to figure out which what app_name is. It cannot determine that from it is location.
It determines it from the chain of events that lead to its execution.
So if it is called while processing a request, whether in the controller or in an imported module, than it should work as intended.
if you call outside of the context of a request (for example in a controller, outside an action) than it may produce a wrong result.
It should raise an exception instead. Will fix this.
If your case is different, indeed, provide an example.
Massimo