This can happen if you have multiple nested iframes - all parent frames needs to specify sandbox="allow-forms" or the permission will be denied.
sandbox="allow-forms"