It depends on how big the flag is and how you waved it.
If it is a small hand flag and you waved it silently, you may not be noticed.
If you wave a big one or wave it loudly and be noticed, you may be taken to the nearby help center and asked a few question. If you were a Chinese, you may be having a class of the protest law, take away your flag, and ask you to report it to police if you want to protest the next time.
I think they may speak to a foreigner politer, but you may stay in police station for a longer time for more investigation to confirm if you are a spy.
Chinese people usually don’t see minority sex preference as a incomprehensible concept. We don’t care who you love if you don’t bother us.
Another interesting story I recently read from an article on zhihu, a Chinese quora-like website. It says in Genshin impact two male characters get along quite well with each other, and some English-speaking players said they are gays while others don’t. Finally the question ends up “Thay are not gays; Chinese people said they are good brothers.”
So I think if gay couples don’t say about it, we may see them as good brothers and relate them with firm friendships.