https://www.holy-bhagavad-gita.org/chapter/18/verse/47
"It is better to do one’s own dharma, even though imperfectly, than to do another’s dharma, even though perfectly. By doing one’s innate duties, a person does not incur sin."
Next verse
"One should not abandon duties born of one’s nature, even if one sees defects in them, O son of Kunti. Indeed, all endeavors are veiled by some evil, as fire is by smoke."
The whole set of verses before and after this verse is worth a read
https://www.holy-bhagavad-gita.org/chapter/18/verse/41
The website adds the phrase "and not by birth" in the translation that is not present in the original Sanskrit verse to mitigate modern sensibilities, but the following verses go on to contradict the additional phrase added in the translation.
There are other verses that shame intercaste marriages as well.