Funny border radius rendering?

I’m making a widget which is a text input with a couple of full-height buttons overlayed and aligned to the right. I don’t want the border of the text input to leak through. I have the text input border radius set to 2, and I want to match that with the top right and bottom right corners of the buttons.

If I set the button radii to 2, or even 1, as in the picture, the border of the text input appears to leak through starting from half the width of the buttons:

If I set the border radius of the buttons to 0, I get pretty much sharp outer corners:

Why do the buttons start to leak the border that’s behind them from 50% of their width, even if the radius selected is nowhere near that?

I experimented with drawing the buttons in a new layer using Renderer::with_layer, but that didn’t seem to make a difference.

Edit: here’s the widget as a whole:
image