You don't use global
$wp_query object anywhere in your code, so there is no point in calling
On the other hand, you do use global
$post variable, so after your code you should restore it's original value with
wp_reset_postdata() and it should be OK.
And one more thing...
Shortcodes should return their values and they should not display anything.
So you can't use
the_title() inside of it - this template tags echoes its value and doesn't return anything.
You should change it to