Problem is not present in CAP 5.4.2, but is in DM 5.4.2, and both distributions in 5.4.3-SNAPSHOT: other errors that WebAcpplication instances are not correctly picked by the wenegine error management (that is used to display a custom error depending on the webengine module).
It appears that this is due to the ExceptionMapper, that is resolved to org.nuxeo.ecm.webdav.provider.ExceptionHandler instead of WebEngineExceptionMapper, see method in com.sun.jersey.spi.container.ContainerResponse:
public boolean mapException(Throwable e) {
ExceptionMapper em = wa.getExceptionMapperContext().find(e.getClass());
if (em == null) return false;