re: treatment of foreign nationals, there is a lot of confusion.
1) people don't know how borders work. You need to first be processed by Ukrainian guards and only then by Polish guards. While Poland was letting everyone in, Ukraine wasn't letting everyone out. I've seen conflicting info from them wanting to process Ukrainians first, to not letting out men of any nationality (some white Luxembourgers had trouble getting out because they were men under 60), to there being specific border crossings devoted to processing foreign nationals because they would be able to get consular help after crossing, as opposed to just crossing randomly and getting no help.
2) obviously, people are racist. While there are thousands of people in Poland willing to help Ukrainians, they're not as willing to help people who aren't white. This is partly due to years of anti-immigrant propaganda, exacerbated by months of the Belarusian border crisis. People arrive at the border willing to transport "mothers with children" anywhere in Poland, but when they see the person needing help is Black/brown, they turn back. I do want to stress there has been very immediate response from charity organisations and non-racist volunteers who set up to specifically help POCs. At the same time, the Polish far-right is engaging in their own propaganda, sending neo-nazi groups to Przemyśl and the border to "protect" the local population. Yesterday, some non-white members of a German charity helping refugees got attacked by a group of white men.
3) Embassies of the foreign nationals are reacting to problems but with hundreds of thousands crossing the borders each day there is obvious chaos.