I'm not quite sure what's going wrong here, but we should probably not assume that a given string has three parts:
list( $headb64, $bodyb64, $sigb64 ) = explode( '.', $JWT );
[2019-01-30 16:01:47] php.WARNING: Notice: Undefined offset: 1 {"exception":"[object] (ErrorException(code: 0): Notice: Undefined offset: 1 at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php:325)"} []
[2019-01-30 16:01:47] php.WARNING: Notice: Undefined offset: 2 {"exception":"[object] (ErrorException(code: 0): Notice: Undefined offset: 2 at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php:325)"} []
[2019-01-30 16:01:47] request.CRITICAL: Uncaught PHP Exception MediaWiki\OAuthClient\Exception: "Decoding server response failed: Syntax error (Raw response: z���l(j�a�)�jX�������ͫb�������g���N���h�,ڶ*'���z�"�*.�����-j����ږ'_�����"�)" at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php line 435 []
This is with the latest code of oauthclient (i.e. includes the recent error reporting improvements).