The reply by @MartinSmith was on the right track. The schema (and optionally database) should have been passed to the object_id function.
object_id(TABLE_SCHEMA+'.'+TABLE_NAME)
grabs the correct results.
The original, which only uses the TABLE_NAME string, always returns the table in the user's default schema - which in this case did not include a table by that name, while the schema being processed did.
To get info on a table in another database, the catalog can be added as well:
object_id(TABLE_CATALOG+','+TABLE_SCHEMA+'.'+TABLE_NAME)