Passing variables that contain HTML through the t() function - ! placeholder has been removed
It appears that any arguments passed to t() function are escaped unless they implement MarkupInterface. So that you need to represent the name as an object.

use Drupal\Component\Render\FormattableMarkup;

$formatted_name = new FormattableMarkup(
  '&lt;span class="fullname-wrapper"&gt;
    &lt;span class="first-name"&gt;@first_name&lt;/span&gt;
    &lt;span class="last-name"&gt;@second_name&lt;/span&gt;
    &lt;span class="account-name-wrapper"&gt;(@user_name)&lt;/span&gt;
   &lt;/span&gt;',
  [
    '@first_name' =&gt; 'John',
    '@second_name' =&gt; 'Hancock',
    '@user_name' =&gt; '@JohnH',
  ]
);

drupal_set_message(t('Your name is @name', ['@name' =&gt; $formatted_name]));