Use pre_get_posts
instead of request
:
function post_type_tags_fix( $request ) {
if ( ! is_admin()
&& $request->is_tag()
&& $request->is_main_query() ) {
$request->set( 'post_type', array( 'type_one', 'type_two' ) )
}
}
add_action( 'pre_get_posts', 'post_type_tags_fix' );