Removed tabindex = -1

I have a big form with 40 inputs, in this form we want to set the tabindex to improve the user experience. The problem was this javascript replaces the tabindex for -1, I don't see a good reason for that as I have removed it. Is there a good reason to replace the tabindex?