Error with HubDB query with lte and gte on same column

I am setting up a custom module which queries a hubdb with events.
The filter in the query uses lte and gte on the date column.
I have setup a pagination function, that basically sets ths start and end date for the query.
The weird thing is that for some sets of start and end date the code does not show errors and for some it does.
Any ideas?
Code snippets:
{% set events_query = “Date__gte=” ~ start_date_display_ms ~ “&Date__lte=” ~ end_date_display_ms %}
{% set events_table = hubdb_table_rows(calender_hubdb_id, events_query ) %}
Debugging code:
{% set events_table = hubdb_table_rows(calender_hubdb_id, ‘Date__gte=1719806075000&Date__lte=1730327075000’ ) is fine
{% set events_table = hubdb_table_rows(calender_hubdb_id, ‘Date__gte=1727754965000&Date__lte=1738275965000’ ) shows warning errors

Hi @jvveen
could you tell us what kind of warning errors you are getting?

Hey @Gracjan , thanks
Just “Warning - Error” with a link to the line. See screenshot.
For debugging, I removed the variables and added the UNIX timestamp integers to exclude any formatting or calculation errors.
The values of these integers are sensible, one being later than the other.
The issues seems to be with the second value. If I change that to gte or increase the number enough, the error changes.

Hi @jvveen ,
Just to clarify, have you tried running your code without the wrapping if statement? I’m assuming the issue persists even without it, but it would be helpful to confirm.
If possible, could you provide us the entire code of your calendar module please?
Best,
Gracjan