According to the SQL Standard, result of subtraction of one datetime value from another is an interval, but Oracle violates the Standard and returns a DATE JULIAN for (DATE - DATE) and NUMBER for (TIMESTAMP - TIMESTAMP) for historic reasons. H2 does not provide compatibility on that level, that's too much, H2 is not an emulator of other databases.
It works in older versions of H2 only because they also violate the Standard and incorrectly return BIGINT values from that subtraction operation. H2 was fixed in 1.4.198, so you can try to use 1.4.197 if you cannot rewrite your query in some correct way. Unfortunately, it looks like Oracle, at least version 18c, doesn't support the datetime and interval arithmetic from the Standard well enough and you need different queries for Oracle and H2.