You can get into a situation where a user cannot edit a variable in variable set even if its team has the VariableEdit / VariableEditUnscoped permissions. It is probably because its team has been restricted to some project or some environments.
In that case, you need the EnvironmentEdit permission to make it work !
I have always met this scenario where one team manages the environment and other teams would just use them but want to edit the variables for their respective environments.
So if you are using Octopus Deploy lower than 3.13.5 (like 3.12.0 for me right now), then you must set the EnvironmentEdit permission on each team wanting to edit variables or you can remove the project / environment restrictions (but this last option won’t work for most of the people).