It does work. You're just not using in the way it's expected.
If you set a particular seed and run some function with randomness, any repetition will be reproducible. But if you call the function multiple times after setting seed once, it'll vary.
Try this, and let us know if it shows different results or same:
set.seed(2021)
rnorm(5)
set.seed(2021)
rnorm(5)
set.seed(2021)
rnorm(5)
set.seed(2021)
rnorm(5)
set.seed(2021)
rnorm(5)