Damn, I got this error recently, but I cannot remember what was the issue.
Anyway, let’s try to do what the helper is supposed to. In the CLI, again:
yunohost tools shell -c "from yunohost.permission import permission_url; permission_url('my_webapp.main' , auth_header=False)"
(edit: removal of extra comma, typing commands on phone is hard)