Alright I partly found the solution . The problem was with the bannercode , which has a higher priority than primary and secondary banner colours and the banner (and troops) will be coloured using the bannercode colours . The color and color2 affect the color of the troops themselves and alternative color is when neither the bannercode nor the primary/secondary contain valid colours . So if you want to make a custom banner for the kingdom , you'll need to use
https://bannerlord.party/banner/ (if you just want to edit a banner copy the code from the xml file and paste it in)