BuffFrame collapse/expand button causes UI taint and Lua errors

Discovered today Lua error trigger while searching for a solution to show/hide Blizz BuffFrames for cleaner UI
(no UI addons involved or installed).

Steps to reproduce:

  1. Create a macro:
    /run BuffFrame.CollapseAndExpandButton()

  2. Use the macro to collapse the personal buff tray.

  3. Reload UI or continue playing with the buff tray collapsed.

  4. Lua errors begin appearing repeatedly.

Result:

The UI starts generating repeated errors from Blizzard_BuffFrame. Example:

Interface/AddOns/Blizzard_BuffFrame/BuffFrame.lua:485:
attempt to perform boolean test on field ‘hideUnlessExpanded’
(a secret boolean value, while execution tainted by ‘ForceTaint_Strong’)

The error repeats hundreds or thousands of times.

Expected result:

The BuffFrame collapse/expand button should either:

  • be safely callable without tainting the UI, or

  • be protected from scripted clicks if that usage is unsupported.

Additional information:

Removing the macro and reloading the UI stops the errors. The issue appears related to the collapsed state of the BuffFrame and the hideUnlessExpanded aura handling.