Upgrade Gutenberg 12.7 + do_blocks() for template part = display:flex CSS property not loaded anymore
Description
Hi everybody,
I'm running into an issue since I upgraded Gutenberg from 12.6.1 to 12.7. The whole site displays properly but one not : the one based on a custom template part.
Here is the code I use for my template part :
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div class="wp-site-blocks">
<?php
echo do_blocks( '<!-- wp:template-part {"slug":"header","theme »:"my-theme","tagName":"header","className":"","layout":{"inherit":true}} /-->' );
// Start the loop.
while ( have_posts() ) : the_post();
// Include the single post content template.
get_template_part( 'template-parts/my-template-part', 'single' );
// End of the loop.
endwhile;
echo do_blocks('<!-- wp:template-part {"slug":"footer","theme »: »my-theme","tagName":"footer","className":"site-footer","layout":{"inherit":true}} /-->');
?>
</div>
<?php wp_footer(); ?>
</body>
</html>
I noticed that every block in it using display:flex are not displayed properly in header and footer. In fact, the CSS property display:flex isn't loaded ! Seems that the issue comes from the « row » Gutenberg block.
Here are some screenshots, for one of the buggy elements:
Code from a page that runs properly :

Code from the page with bugs :

Do you have any idea of how to resolve this ?
Running WP 5.9.1 Gutenberg 12.7.0
Thank you very much for your help !
Step-by-step reproduction instructions
- Using the custom template part with the do_blocks() function (source: https://fullsiteediting.com/lessons/how-to-use-php-templates-in-block-themes/)
- Use some "row" Gutenberg elements
- Upgrade from Gutenberg 12.6.1 to 12.7
Screenshots, screen recording, code snippet
No response
Environment info
Running WP 5.9.1 Gutenberg 12.7.0
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Thanks for contributing, @base-creme.
I think this issue is similar to what @carolinan reported in #39207.
Indeed. Thank you !
I will close this as a duplicate and link it into the original issue if that's okay with you.