Calling from Java JSR223 publishMQTT() impossible

The correct caption is Java JSR 223, not JavaScript JSR 223. With JavaScript it works, as JS is dynamically typed language. I do not know why the caption was changed.

With Java JSR 223 I mean the add-on from Java223 Scripting - Script with Java on openHAB [5.0.1.0,6.0.0.0) .

With JSScripting (GraalVM) this worked

var mqtt_broker = actions.get("mqtt", "mqtt:broker:b1")
mqtt_broker.publishMQTT("a", "b")

so the question is explicitly not for JavaScript.