I just think creating a solution to a problem that shouldn’t exist by introducing ways that could likely exacerbate the problem may not be the best path forward here.
To clarify, I don’t necessarily think that what you’re proposing is a “hack”. But by introducing more layers (no pun intended), we’re essentially encouraging developers to circumvent the whole reason z-layers were introduced to begin with.
If it is true that the packages you are using is the cause of z-index conflicts (I’ve never had this problem with any credible packages that I’ve used btw), I would just open a PR on that packages repository or perhaps use a better package.
FWIW, I’m a firm believer in giving the people what they want. So if there are many developers who run into this problem and think your solution is necessary, we probably should move forward with it. So that’s why I was curious of knowing if this is really a huge problem you’re trying to solve or if it is more rare than you think.