Workflow step which contain property to restrict comment is blocking transition with comment before status changed.
Mentioned property jira.permission.comment.user value denied/false.
- Create a project with a workflow having property as above in Closed step
- Create an issue
- Transition the issue until Close Issue transition's screen
- Add a comment and proceed with transitioning the issue, JIRA will throw error saying current user doesn't have the permission to comment
Adding comment should be possible as the issue status is not yet transitioned into restricted status for commenting. This expected behavior is also tied to this bug - JRA-40629