wp query – Shortcode Not Working in Slider When Added To Post Title

I’ve coded a shortcode to add manually to specific post title fields so i can style part of a title

add_shortcode( 'green', 'green_shortcode' );
function green_shortcode( $atts, $content = 0 ) {

    $a = shortcode_atts( array(
        'class' => 'green',
    ), $atts );

    return '<span class="' . $a('class') . '">' . $content . '</span>';

This works on the single post titles but doesn’t parse the shortcode when pulling the title into a slider.

This is the messed up HTML output from the slider

<h2><a href="http://newlocal.local/this-is-a-featured-post-4/" title="This  is a Featured Post #4">This <span class="green"> is a Featured Post #4</span></a></h2>

Here’s a visual

enter image description here

I have added do_shortcode to the post title PHP but it doesn’t fix the problem

do_shortcode( get_the_title() );

The slider uses a WP_Query

new WP_Query( $query_args );

printf( '<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );