1st of all, thanks for your effort, I use LyX myself.
The doc says:
this indicates that the widget will paint over its entire area with opaque colors. The widget's area will initially be uninitialized
set the widget's Qt::WA_OpaquePaintEvent, avoiding any unnecessary overhead associated with repainting the widget's background
Meaning it is saying it won't bother painting a background but it's not committing to leaving the old painted background in place so I still think you are relying on undefined behaviour.
On the other hand, I think this also impacts the performance of widgets with Qt::WA_OpaquePaintEvent on macOS so it is probably worth highlighting it with a bug report and/or an email on the mailing list