Temporary tables are only available in the session. It's possible that when you run the other query its executed in other session?