The Unified Content Build Pipeline introduced a number of improvements which fix this issue. Unfortunately, UCBP cannot be backported to earlier versions as it is a major change and a full fledged feature. My recommendation is that the project affected by this gets upgraded to Unity 2023.1.0a16 or higher, since the issue is fixed then.