Index: src/wp-includes/blocks.php
===================================================================
--- src/wp-includes/blocks.php	(revision 56430)
+++ src/wp-includes/blocks.php	(working copy)
@@ -137,9 +137,11 @@
 	// Cache $template_path_norm and $stylesheet_path_norm to avoid unnecessary additional calls.
 	static $template_path_norm   = '';
 	static $stylesheet_path_norm = '';
+
+	// Trailing slashes are needed to properly match parent and child themes directories with similar names.
 	if ( ! $template_path_norm || ! $stylesheet_path_norm ) {
-		$template_path_norm   = wp_normalize_path( get_template_directory() );
-		$stylesheet_path_norm = wp_normalize_path( get_stylesheet_directory() );
+		$template_path_norm   = trailingslashit( wp_normalize_path( get_template_directory() ) );
+		$stylesheet_path_norm = trailingslashit( wp_normalize_path( get_stylesheet_directory() ) );
 	}
 
 	$script_path_norm = wp_normalize_path( realpath( dirname( $metadata['file'] ) . '/' . $script_path ) );
@@ -254,9 +256,11 @@
 		// Cache $template_path_norm and $stylesheet_path_norm to avoid unnecessary additional calls.
 		static $template_path_norm   = '';
 		static $stylesheet_path_norm = '';
+
+		// Trailing slashes are needed to properly match parent and child themes directories with similar names.
 		if ( ! $template_path_norm || ! $stylesheet_path_norm ) {
-			$template_path_norm   = wp_normalize_path( get_template_directory() );
-			$stylesheet_path_norm = wp_normalize_path( get_stylesheet_directory() );
+			$template_path_norm   = trailingslashit( wp_normalize_path( get_template_directory() ) );
+			$stylesheet_path_norm = trailingslashit( wp_normalize_path( get_stylesheet_directory() ) );
 		}
 
 		// Determine if the block style was registered in a theme, by checking if the script path starts with either
