It's called "Chromatic aberration", and you can fix it like this: https://www.damiensymonds.net/2014/12/fixing-chromatic-aberration.html
It happens, sometimes, on edges of high contrast, and I believe some lenses are more prone to it than others.
Some really good info about CA from Brian in this post.