diff --git a/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php b/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php
index c536c55fdfcc..859a66447007 100644
--- a/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php
+++ b/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php
@@ -246,7 +246,7 @@ private function getReturnTypeValue(\ReflectionMethod $method): ?string
         $returnTypeValue = null;
         $returnType = $method->getReturnType();
         if ($returnType) {
-            $returnTypeValue = ($returnType->allowsNull() ? '?' : '');
+            $returnTypeValue = ($returnType->allowsNull() && $returnType->getName() !== 'mixed' ? '?' : '');
             $returnTypeValue .= ($returnType->getName() === 'self')
                 ? $this->_getFullyQualifiedClassName($method->getDeclaringClass()->getName())
                 : $returnType->getName();
diff --git a/vendor/magento/framework/Code/Generator/EntityAbstract.php b/vendor/magento/framework/Code/Generator/EntityAbstract.php
index 0e440909d86c..8ccf26db333d 100644
--- a/vendor/magento/framework/Code/Generator/EntityAbstract.php
+++ b/vendor/magento/framework/Code/Generator/EntityAbstract.php
@@ -352,7 +352,7 @@ private function extractParameterType(
             $typeName = $parameterType;
         }

-        if ($parameter->allowsNull()) {
+        if ($parameter->allowsNull() && $typeName !== 'mixed') {
             $typeName = '?' . $typeName;
         }

diff --git a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php
index c363f808776c..4b8685facad7 100644
--- a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php
+++ b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php
@@ -212,7 +212,7 @@ private function getReturnTypeValue(\ReflectionMethod $method): ?string
         $returnTypeValue = null;
         $returnType = $method->getReturnType();
         if ($returnType) {
-            $returnTypeValue = ($returnType->allowsNull() ? '?' : '');
+            $returnTypeValue = ($returnType->allowsNull() && $returnType->getName() !== 'mixed' ? '?' : '');
             $returnTypeValue .= ($returnType->getName() === 'self')
                 ? $this->_getFullyQualifiedClassName($method->getDeclaringClass()->getName())
                 : $returnType->getName();
diff --git a/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php b/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php
index a45795e5df16..f9bf616681cb 100644
--- a/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php
+++ b/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php
@@ -1,7 +1,5 @@
 <?php
 /**
- * Proxy generator
- *
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
@@ -9,22 +7,17 @@

 namespace Magento\Framework\ObjectManager\Code\Generator;

-/**
- * Class Proxy
- *
- * @package Magento\Framework\ObjectManager\Code\Generator
- */
 class Proxy extends \Magento\Framework\Code\Generator\EntityAbstract
 {
     /**
      * Entity type
      */
-    const ENTITY_TYPE = 'proxy';
+    public const ENTITY_TYPE = 'proxy';

     /**
      * Marker interface
      */
-    const NON_INTERCEPTABLE_INTERFACE = \Magento\Framework\ObjectManager\NoninterceptableInterface::class;
+    public const NON_INTERCEPTABLE_INTERFACE = \Magento\Framework\ObjectManager\NoninterceptableInterface::class;

     /**
      * Returns default result class name
@@ -287,7 +280,7 @@ private function getReturnTypeValue(\ReflectionMethod $method): ?string
         $returnTypeValue = null;
         $returnType = $method->getReturnType();
         if ($returnType) {
-            $returnTypeValue = ($returnType->allowsNull() ? '?' : '');
+            $returnTypeValue = ($returnType->allowsNull() && $returnType->getName() !== 'mixed' ? '?' : '');
             $returnTypeValue .= ($returnType->getName() === 'self')
                 ? $this->_getFullyQualifiedClassName($method->getDeclaringClass()->getName())
                 : $returnType->getName();

