You are correct that racism as we know it is a product of, roughly speaking, the post-1550 world. The response to homoerotic acts has varied extremely widely across time and space. "Same sex couples" were pretty uncommon in most times and places (largely because almost no one thought of marriage/cohabitation as something constituted primarily by romantic love or even sexual desire). But plenty of examples of people having same-sex sex and even long-lasting relationships.