UA was within their rights to deny boarding. Airlines are fined heavily if they transport a pax who doesn't have the proper docs. It is incumbent on the traveler to educate themselves with the immigration policy of their destination, and to make sure their affairs are in order.
Of course, the OP could do something strange and unusual these days, and perhaps just make sure that they are in compliance with entry rules for their destination. I don't know...just a thought.