According to:
https://blog.virginatlantic.com/airb...ar-zorro-mask/
For the A350, It has to do with the windows being curved glass rather than flat (for less drag) and matching thermal expansion between the dark-tinted glass and frame.
And simplify maintenance (no need to paint them with different livery colors every time the glass needs re-installing).
I presume that means the curved glass might be more prone to crack or pop out of the frame without a black frame to absorb heat (solar heating) and expand/contract in sync with the glass.
On the A330neo, simply to maintain consistent look throughout the (new) lines.
However, some AB engineers also agree with
Fursty Ferret - "It just looks better!"