Maybe this new R package can be a solution to your question? https://www.sciencedirect.com/science/article/pii/S2468265924000854
Lai J, Tang J, Li T, Zhang A, Mao L (2024) Evaluating the relative importance of predictors in Generalized Additive Models using the gam.hp R package. Plant Diversity, 46, 542-546.