We have an APEX page that checks for duplicate submissions (using the APEX page attribute). In some environments it gives the expected error:

However in others we instead get:

Both environments are as follows:
Java jdk1.8.0_112
Tomcat apache-tomcat-9.0.17
Oracle 18.0.0.0.0SE
Apex 18.2.0.00.12
ORDS 18.4.0.r3541002
Can anyone suggest what may be causing the difference in behaviour?