diff --git a/lib/Drupal/Component/Utility/Html.php b/lib/Drupal/Component/Utility/Html.php
index 7271519e51..9d8c4d08ab 100644
--- a/core/lib/Drupal/Component/Utility/Html.php
+++ b/core/lib/Drupal/Component/Utility/Html.php
@@ -425,6 +425,25 @@ EOD;
    * @ingroup sanitization
    */
   public static function escape($text): string {
+
+    // Temporary patch to mask TypeError WSOD if Argument in $text is Array instead of text.
+    // See https://www.drupal.org/node/3352384 for more.
+    if (is_array($text)) {
+      @trigger_error('Passing Arguments of Type Array to ' . __METHOD__ . ' will trigger a PHP TypeError in drupal:9.5.7 and higher. Pass a string instead. See https://www.drupal.org/node/3352384', E_USER_DEPRECATED);
+      \Drupal::messenger()->addMessage('Passing Arguments of Type Array to ' . __METHOD__ . ' will trigger a PHP TypeError in drupal:9.5.7 and higher. Pass a string instead. See <a href="https://www.drupal.org/node/3352384">Drupal core issue 3352384</a> for more details. Enable var_dump() or Devel dpm() by uncommenting the lines 435-442 from this patch added in \Drupal\Component\Utility\Html.php.', 'error', FALSE, $uid = 0);
+
+      // Enable for debugging only.
+      //
+      // if (\Drupal::moduleHandler()->moduleExists('devel')) {
+      // dpm($text);
+      // }
+      // else {
+      // var_dump($text);
+      // }
+
+      // To prevent site being not operable we suppress TypeError in case of type Array by converting into type Text before substitution.
+      return htmlspecialchars((string) $text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
+    }
     if (is_null($text)) {
       @trigger_error('Passing NULL to ' . __METHOD__ . ' is deprecated in drupal:9.5.0 and will trigger a PHP error from drupal:11.0.0. Pass a string instead. See https://www.drupal.org/node/3318826', E_USER_DEPRECATED);
       return '';
