This issue was clarified and given a new description - the old one is below.
A grade item that is hidden could have been hidden because of the activity settings, or because it was manually hidden in the gradebook.
We could change the valid states for a grade_item to "Hidden/Visible/Based on activity settings" to make this clearer.
There appears to have been a change that breaks
- create an assignment
- Assignment is visible and gradebook item is visible
- go into the grade book and set the grade item as hidden or hidden until
- Assignment is visible and gradebook items is hidden
- hide the assignment
- assignment and gradebook are both hidden
- unhide the assignment
- assignment and gradebook are both visible, the hidden / hidden until setting having been lost.
Tested this on our 2.6 version but also found on the demo.moodle.net version so this affects the latest version too.