Index: src/wp-includes/class-wp-customize-manager.php
===================================================================
--- src/wp-includes/class-wp-customize-manager.php	(revision 49608)
+++ src/wp-includes/class-wp-customize-manager.php	(working copy)
@@ -439,8 +439,9 @@
 	 *
 	 * @param string|WP_Error $ajax_message Ajax return.
 	 * @param string          $message      Optional. UI message.
+	 * @param int             $response     Optional. HTTP response code.
 	 */
-	protected function wp_die( $ajax_message, $message = null ) {
+	protected function wp_die( $ajax_message, $message = null, $response = 500 ) {
 		if ( $this->doing_ajax() ) {
 			wp_die( $ajax_message );
 		}
@@ -472,7 +473,7 @@
 			$message .= ob_get_clean();
 		}
 
-		wp_die( $message );
+		wp_die( $message, $response );
 	}
 
 	/**
@@ -521,7 +522,7 @@
 
 		// If a changeset was provided is invalid.
 		if ( isset( $this->_changeset_uuid ) && false !== $this->_changeset_uuid && ! wp_is_uuid( $this->_changeset_uuid ) ) {
-			$this->wp_die( -1, __( 'Invalid changeset UUID' ) );
+			$this->wp_die( -1, __( 'Invalid changeset UUID.' ), 400 );
 		}
 
 		/*
@@ -548,7 +549,11 @@
 		 * then send unauthenticated code to prompt re-auth.
 		 */
 		if ( ! current_user_can( 'customize' ) && ! $this->changeset_post_id() ) {
-			$this->wp_die( $this->messenger_channel ? 0 : -1, __( 'Non-existent changeset UUID.' ) );
+			$this->wp_die(
+				$this->messenger_channel ? 0 : -1,
+				__( 'Non-existent changeset UUID.' ),
+				404
+			);
 		}
 
 		if ( ! headers_sent() ) {
@@ -567,7 +572,11 @@
 			// If the requested theme is not the active theme and the user doesn't have
 			// the switch_themes cap, bail.
 			if ( ! current_user_can( 'switch_themes' ) ) {
-				$this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
+				$this->wp_die(
+					-1,
+					__( 'Sorry, you are not allowed to edit theme options on this site.' ),
+					403
+				);
 			}
 
 			// If the theme has errors while loading, bail.
Index: tests/phpunit/includes/abstract-testcase.php
===================================================================
--- tests/phpunit/includes/abstract-testcase.php	(revision 49608)
+++ tests/phpunit/includes/abstract-testcase.php	(working copy)
@@ -443,9 +443,11 @@
 	 *
 	 * @throws WPDieException Exception containing the message.
 	 *
-	 * @param string $message The `wp_die()` message.
+	 * @param string|WP_Error  $message The `wp_die()` message.
+	 * @param string|int       $title The `wp_die()` title.
+	 * @param string|array|int $args The `wp_die()` args.
 	 */
-	public function wp_die_handler( $message ) {
+	public function wp_die_handler( $message, $title, $args ) {
 		if ( is_wp_error( $message ) ) {
 			$message = $message->get_error_message();
 		}
@@ -454,7 +456,7 @@
 			$message = '0';
 		}
 
-		throw new WPDieException( $message );
+		throw new WPDieException( $message, $title, $args );
 	}
 
 	/**
Index: tests/phpunit/includes/exceptions.php
===================================================================
--- tests/phpunit/includes/exceptions.php	(revision 49608)
+++ tests/phpunit/includes/exceptions.php	(working copy)
@@ -6,8 +6,66 @@
 
 /**
  * General exception for wp_die().
+ *
+ * @package    WordPress
+ * @subpackage Unit Tests
  */
-class WPDieException extends Exception {}
+class WPDieException extends Exception {
+	/**
+	 * Title passed to `wp_die()`.
+	 *
+	 * @since 5.7.0
+	 *
+	 * @var string|int
+	 */
+	protected $title;
+
+	/**
+	 * Args passed to `wp_die()`.
+	 *
+	 * @since 5.7.0
+	 *
+	 * @var string|array|int
+	 */
+	protected $args;
+
+	/**
+	 * Constructor.
+	 *
+	 * @since 5.7.0
+	 *
+	 * @param string|WP_Error  $message The `wp_die()` message.
+	 * @param string|int       $title The `wp_die()` title.
+	 * @param string|array|int $args The `wp_die()` args.
+	 */
+	public function __construct( $message, $title = '', $args = array() ) {
+		parent::__construct( $message );
+		$this->title = $title;
+		$this->args  = $args;
+	}
+
+	/**
+	 * Gets the title passed to `wp_die()`.
+	 *
+	 * @since 5.7.0
+	 *
+	 * @var string|int
+	 */
+	public function getTitle() {
+		return $this->title;
+	}
+
+	/**
+	 * Gets the args passed to `wp_die()`.
+	 *
+	 * @since 5.7.0
+	 *
+	 * @var string|array|int
+	 */
+	public function getArgs() {
+		return $this->args;
+	}
+}
 
 /**
  * Exception for cases of wp_die(), for Ajax tests.
Index: tests/phpunit/tests/customize/manager.php
===================================================================
--- tests/phpunit/tests/customize/manager.php	(revision 49608)
+++ tests/phpunit/tests/customize/manager.php	(working copy)
@@ -254,7 +254,8 @@
 			$exception = $e;
 		}
 		$this->assertInstanceOf( 'WPDieException', $exception );
-		$this->assertContains( 'Invalid changeset UUID', $exception->getMessage() );
+		$this->assertContains( 'Invalid changeset UUID.', $exception->getMessage() );
+		$this->assertEquals( 400, $exception->getArgs()['response'] );
 
 		update_option( 'fresh_site', '0' );
 		$wp_customize = new WP_Customize_Manager();
@@ -312,6 +313,7 @@
 		}
 		$this->assertInstanceOf( 'WPDieException', $exception );
 		$this->assertContains( 'Non-existent changeset UUID', $exception->getMessage() );
+		$this->assertEquals( 404, $exception->getArgs()['response'] );
 
 		wp_set_current_user( self::$admin_user_id );
 		$wp_customize = new WP_Customize_Manager( array( 'messenger_channel' => 'preview-1' ) );
