You are using the mendix client api directly, this is not supported for Pluggable widgets.
You can achieve the same thing using the Pluggable Widgets API: https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets