how to show logged in members username in wordpress content

It looks like $current_user->user_firstname contains some tag content.

I would replace that line with:

<h5>Hi <?php echo esc_html($current_user->user_firstname); ?></h5>

or

<h5>Hi <?php echo strip_tags($current_user->user_firstname); ?></h5>

One of those (or either) may solve your problem outright.