The State Department issues warnings for US citizens. It does not care if othet nationalities go there.
And speaking of it is safe to return there, I am not familiar with what happens when the TPS status is removed, but I think it only means they’re no longer welcome in the US, not necessarily being deported to Somalia the next day. So I don’t see any contradiction.