Index: /trunk/src/wp-includes/class-wp-scripts.php
===================================================================
--- /trunk/src/wp-includes/class-wp-scripts.php	(revision 63578)
+++ /trunk/src/wp-includes/class-wp-scripts.php	(revision 63579)
@@ -528,5 +528,6 @@
 		}
 
-		$script   = (array) $this->get_data( $handle, $position );
+		$script   = $this->get_data( $handle, $position );
+		$script   = false === $script ? array() : (array) $script;
 		$script[] = $data;
 
Index: /trunk/tests/phpunit/tests/dependencies/scripts.php
===================================================================
--- /trunk/tests/phpunit/tests/dependencies/scripts.php	(revision 63578)
+++ /trunk/tests/phpunit/tests/dependencies/scripts.php	(revision 63579)
@@ -228,4 +228,36 @@
 			'defer' => array( 'defer' ),
 			'async' => array( 'async' ),
+		);
+	}
+
+	/**
+	 * Tests that inline scripts do not include a false entry when no data exists yet.
+	 *
+	 * @ticket 52320
+	 * @dataProvider data_inline_script_positions
+	 *
+	 * @param string $position Inline script position.
+	 */
+	public function test_add_inline_script_does_not_store_false_for_empty_existing_data( $position ): void {
+		$handle = 'test-inline-script-' . $position;
+
+		wp_register_script( $handle, '/test.js', array(), null );
+		wp_add_inline_script( $handle, 'console.log( "test" );', $position );
+
+		$this->assertSame(
+			array( 'console.log( "test" );' ),
+			wp_scripts()->get_data( $handle, $position )
+		);
+	}
+
+	/**
+	 * Data provider for inline script positions.
+	 *
+	 * @return array<string, array{0: string}> Inline script positions.
+	 */
+	public function data_inline_script_positions(): array {
+		return array(
+			'before' => array( 'before' ),
+			'after'  => array( 'after' ),
 		);
 	}
