I want to re-iterate what Evgeny said ... you should never store your persistent objectscript class definition in source control without the storage definition block.  Doing so will cause the storage block to be regenerated from scratch each time source is loaded, and if there is existing data you may have a mismatch of where properties exist on disk and where where the source thinks they should live

@Alexandra Mirzac - welcome to the Community :)  I would suggest the following:

1) Make sure you have saved and compiled your class, and that it returned with no errors.  

2) Make sure when you are testing in Terminal you are connected to the correct Instance and the correct Namespace

3) Double-check spelling and case in your Terminal command compared to your compiled classname

Please try those things out and let us know if that moves you forward.

I don't have access to an active HS environment at the moment, but from testing the last part of your query, it looks correct to me.  You are saying with the query that has the literal timestamp you get results, but with the 2nd query which targets the prior 2 hours you are getting no results?  are you sure that there are records in that time window to fetch?  What happens if you change it to a 24 hour window (-24)?