Text with display-p3 color is rendered as srgb

I’m building a plugin and want to use P3 colors. I noticed that color(display-p3 ...) gets rendered as srgb when used in color property of a div.

It’s not reproduced in CodePen in Chrome, looks like it’s an internal Figma bug.
How do I make a text element display using p3 colors?