The reason why your Ralts and Sableye aren't breeding is because in Gen 7, Ralts wasn't in the Human-Like Egg Group
If you go to the Ralts page on Bulbapedia and scroll down to the Egg Groups section, you'll find it saying:
Human-Like (Gen VIII) and Amorphous
This means that Ralts was in the Human-Like Egg group starting in Gen 8. Because you're breeding Ralts and Sableye in Gen 7, Ralts wasn't in the Human-Like Group and was only in the Amorphous Group. Since Sableye is in the Human-Like Group while Ralts isn't in Gen 7, they can't breed in Ultra Sun/Ultra Moon. If you're still trying to breed Ralts and Sableye together, I'd recommend doing so in a Generation 8 Game, like Sword/Shield. :)
Hope this helps.