We need a reproducible example (reprex)
As @ FJCC points out your code is not making sense. There is clearly something we are missing.