Does Kruskal-Wallis test have a non-parametric analogue that isn't sensitive to groups having different variability? I need a non-parametric test for my project (because I can't be sure that the distribution would always be normal), so I decided to use Kruskal-Wallis test.
But the problem is that Kruskal-Wallis test doesn't return the correct result if the groups doesn't have the same variability.
Does Kruskal-Wallis test has a non-parametric analogue that isn't sensitive to groups having different variability?

Example: Consider the following fictitious data:
set.seed(2022)
x1 = rgamma(50, 2, .3)
x2 = rgamma(50, 3, .3)
x3 = rgamma(50, 4, .3)
x = c(x1, x2, x3)
g = rep(1:3, each=50)

The three groups have different variances and slightly different skewnesses.
boxplot(x~g, horizontal=T, col=c("maroon","green3","blue"))


Kruskal-Wallis test shows differences with P-value near $0.$
kruskal.test(x~g)

        Kruskal-Wallis rank sum test

data:  x by g
Kruskal-Wallis chi-squared = 42.46, df = 2,
p-value = 6.023e-10

A plot of empirical CDFs (ECDFs) shows that
sample x3 (blue) stochastically dominates x2, which
in turn stochastically dominates x1.
hdr = "ECDF plots of x1 (maroon), x2 (green) and x3"
plot(ecdf(x3), col="blue", main=hdr)
 lines(ecdf(x2), col="green3")
 lines(ecdf(x1), col="maroon")


