How to target LWC by name attribute?
the problem is that the name attribute is not placed on the lightning-input element but on the internal input element. So you are trying to access component internals which is prevented by Lockerservice as you are not the owner of the lightning namespace.
If you want to select the component element you have to use something like a data attribute like mentioned in your Note