Hiding sections by index seems busted, if part of the content is already hidden. Writer gets thusly confused, and shows parts regardless when you do that iteratively.
Problem shows when using WollMux, but it's a generic implementation issue.
User Profile Reset: No
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Serge Krot committed a patch related to this issue.
It has been pushed to "master":
tdf#117668 Fix wrong number of sections in document
It will be available in 6.1.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.