Correct way to alter markup as html within theme_preprocess_container?
You can't modify a markup object, but you can use the create() method on a new markup object to replace the old one.

$variables['children'] = \Drupal\Core\Render\Markup::create('&lt;div&gt;Manually set&lt;/div&gt;');


By the way, you are modifying a twig debug message which won't be there in a production environment.