We had similar issues in the past. I remember the answer being a setting in one's profile. Now I view this page as guest https://docs.moodle.org/38/en/File_resource. There is no table of content. But if I add the proper anchor to the URL like https://docs.moodle.org/38/en/File_resource#Files_from_Google_Drive_and_OneDrive, then I'm taken to the right section. Is there a hidden table of content?
A table of contents is automatically added when the page has at least 4 headings. When there are less than 4 headings, a table of contents can be created by adding
__TOC__ to the page. As you've noticed, headings always have anchor links.