Ok I activated trace logs, it told me that there shouldn't be a semi-colon in the end of the query. I removed it but it didn't help.
Then I changed my index pattern: I used one my database date fields instead of @timestamp and apparently that's what was creating the issue.
Now I have a problem because I want to calculate the difference between two dates, but that's for another thread
(if someone knows the solution, an answer by PM is welcome
)
Good luck with your problem @kartheek91!