JPA doesn't do anything special with the ordering, it just generates the ORDER BY clause that gets passed to the database, so it's almost assuredly an issue with the database. Are you using a different database, or different connection parameters in the cases where you see different results? If the collation settings are different in the different scenarios you could see something like this.
Edit 1:
This other Stack Overflow question appears to resolve this issue:
stackoverflow.com/questions/8818201/oracle-order-by-different