The cause is that the sample is a UI plug-in (kUIPlugIn in BscTA.fr), while the Export UI writes IDML asynchronously, on a background thread. Bosses from UI plug-ins cannot be instantiated on a background thread ("the system behaves as if the plug-in were missing and returns a nil pointer"), so the export never sees the text attribute (kBscTAAttrBoss) or its script provider, and the attribute is silently left out of the IDML.
A script that calls exportFile writes the IDML synchronously on the main thread, so the attribute is written (BasictextadornmentShade="true" on the CharacterStyleRange) and comes back when the IDML is opened. asynchronousExportFile behaves like File > Export and loses it.
To fix the sample, move everything that ends up in the document (the text attribute, the adornment, the script provider, the error string service and the document responder) into a model plug-in (kModelPlugIn), and keep only the menu actions (the action component and MenuDef/ActionDef) in a separate UI plug-in. I tested a model-only build with the menu actions removed: both exportFile and asynchronousExportFile kept the attribute, and the adornment came back on reopening.
See the Plug-In Programming Guide, Volume 1: "Multithreading" ("Features that use multithreading" and "Rules for thread safety") and "Model and UI Separation".
Tested on InDesign 2026 (21.0), Windows.