Cool. - You found the issue. :) I'm also curious, so here's an idea:
As I also use a pre_get_posts-filter to manipulate the post_type in $wp_query, it looks to me like a race condition between the two filters.
Your code sets the post_type to array('post', 'software', 'documents', 'news', 'nav_menu_item', 'page'); if the post_type has not been set before.
TagPages sets the post_type to array('post', 'page') if the post_type has not been set before.
So, if the TagPages-filter is executed before your filter, it will never reach your else-fork.
The default $priority = 10 for all filters, so I think setting your function to a higher priority (e.g. to 9) would achieve the desired functionality.