The key usage was like $this->$accept instead of $this->accept causing error undefined variable $accept.
I know this is a part of Joomla-framework/Form package, but that repo has changed drastically as compared to the current CMS copy. If this still not ok to PR here, please advise.
It isn't that one. The packages coming from the framework are in https://github.com/joomla/joomla-cms/tree/staging/libraries/vendor/joomla
So this PR is perfectly fine here.