Make sure you check "use root" if that is in the dialogue
Go into SU and make sure Tasker is allowed to get root.
But still might not work because secure settings sometimes has problems with newer root.
So next step is forget secure settings and use tasker run shell with linux shell commands:
Run Shell: svc data enable ... with "use root" checked (turns data on)
Run Shell: svc data disable ... with "use root" checked (turns data off)
The above doesn't rely on secure settings and really should work (works fine for me).
If all else fails for this command or other root commands, try temporarily disabling secure linux enforcing by doing this before attempting to turn data on/off
run shell setenforce permissive (use root)
... and this after changing data state:
run shell setenforce enforcing (use root)
(you are more vulnerable to a range of attacks in permissive mode so it's important to set it back to enforcing when you're done).
A great thread on using linux/tasker shell commands instead of secure settings here:
https://www.reddit.com/r/tasker/comments/4goz99/how_to_replace_some_secure_settings_actions_with/
In particular everything in the long list of settings for system, global, and secure are all available from shell command.