It is often because the butter hasn’t been stored correctly – warm temperatures, light and moisture can all cause butter to deteriorate quickly and become rancid. If the darker yellow layer is quite thin and the aroma isn’t too sour, then you can just cut away the outside layer before using.