A little update: I've finaly found some kind of solution: I've switched to glaze!
I made some test cookies, some with royal icing and some with glaze, and I exposed them to the sun. The results: the RI turned yellow in a few hours, the glaze stayed white and spotless.
I think this is because RI is porous and absorbs the butter.
I won't use glaze for everything, though, flooding with glaze is a real pain... in the hand!