It usually comes down to different NLS params between your 2 sessions.
Your date must not be a date if you're doing an UPPER?
You haven't provided any evidence that there is a bug, As Jeff says, using UPPER on a date column doesn't make any sense. Nor does using TO_DATE.
What is the structure of the tables involved?