UTF-8 Encoding bei Fehler

Hallo Zusammen,

ich bin dabei eine ERP Schnittstelle für SW6 in Python zu entwickeln und ich habe festgestellt, dass SW Fehlermeldungen falsch zurück gibt und Symfony selbst einen Fehler wirft.

Was ich damit meine ist, dass ich eine Anfrage an den Shop stelle, welche nicht verarbeitet werden kann. Wenn ich z.B. eine Anfrage stelle in der eine duplicate entry error geworfen wird (z.B. UUID ist bereits an eine andere Ressource vergeben) dann bekomme ich folgende Fehlermeldung:

<Response [500] >
{
    'errors': [
        {
            'code': '0', 'status': '500', 'title': 'Internal Server Error', 'detail': 'Malformed UTF-8 characters, possibly incorrectly encoded', 'meta': {
                'trace': [
                    { 'file': '/var/www/html/vendor/symfony/http-foundation/JsonResponse.php', 'line': 54, 'function': 'setData', 'class': 'Symfony\\Component\\HttpFoundation\\JsonResponse', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/shopware/core/Framework/Api/Controller/SyncController.php', 'line': 166, 'function': '__construct', 'class': 'Symfony\\Component\\HttpFoundation\\JsonResponse', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpKernel.php', 'line': 156, 'function': 'sync', 'class': 'Shopware\\Core\\Framework\\Api\\Controller\\SyncController', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpKernel.php', 'line': 78, 'function': 'handleRaw', 'class': 'Symfony\\Component\\HttpKernel\\HttpKernel', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/Kernel.php', 'line': 199, 'function': 'handle', 'class': 'Symfony\\Component\\HttpKernel\\HttpKernel', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php', 'line': 86, 'function': 'handle', 'class': 'Symfony\\Component\\HttpKernel\\Kernel', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php', 'line': 479, 'function': 'handle', 'class': 'Symfony\\Component\\HttpKernel\\HttpCache\\SubRequestHandler', 'type': '::' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php', 'line': 269, 'function': 'forward', 'class': 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php', 'line': 285, 'function': 'pass', 'class': 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/symfony/http-kernel/HttpCache/HttpCache.php', 'line': 213, 'function': 'invalidate', 'class': 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/shopware/core/HttpKernel.php', 'line': 181, 'function': 'handle', 'class': 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache', 'type': '->' }, 
                    { 'file': '/var/www/html/vendor/shopware/core/HttpKernel.php', 'line': 81, 'function': 'doHandle', 'class': 'Shopware\\Core\\HttpKernel', 'type': '->' }, 
                    { 'file': '/var/www/html/public/index.php', 'line': 77, 'function': 'handle', 'class': 'Shopware\\Core\\HttpKernel', 'type': '->' }], 
                'file': '/var/www/html/vendor/symfony/http-foundation/JsonResponse.php', 'line': 171
            }
        }]
}

Ich habe mir den Symfony code angeguckt und auch per PHP-Debugger geschaut was passiert. Das Problem scheint folgendes zu sein:
SW versucht die Ursprüngliche Fehlermeldung „dublicate entry“ als Antwort in den HTTP Request zu geben, jedoch schein Symfony dann ein problem mit dem encoding zu haben und läuft in einen Fehler.
Dieser Symfony-Fehler ist nun in dem Response von dem Request. Dieser hilft mir jedoch nicht weiter herauszufinden wo das Problem ist, geschweige den eine Sinnvolle Fehlerbehandlung zu entwickeln.

Hat sonst jemand dieses Problem mit SW6 und Python oder einer anderen Programmiersprache und hat eine Lösung?
Ich nutze die request Bibliothek für die HTTP-Requests und Python version 3.7.

Ist dies eine Problem von SW6 oder von Symfony oder gar von Python?