Size property error of a component variant in a component variant

Hey yall,

I’m confused about a behavior of a component. I have buttons that can be of two kinds: primary and secondary. Putting either in a component (the black bar) is no issue but once I do that in a variant of the bar, the colors change but not the size. I don’t know what causes this. Is this a bug or I’m missing something? New to Figma myself

Thanks to whoever knows the answer to in advance