Links to nested heading not updating when heading is renamed

Steps to reproduce

Create two notes:

Note1

#Header1

## Header2

Note2

[[Note1#Header1]]
[[Note1#Header1#Header2]]

Rename #Header1 in Note1 to #Header99 using the “Rename this heading…” command.
The bug also occurs if renaming Header2 to #Header55 using this command.
It occurs for all levels of subheadings, but I’m just giving two examples here.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

When renaming Header1, both instances of Header1 should be renamed to Header99.

Note2

[[Note1#Header99]]
[[Note1#Header99#Header2]]

When renaming Header2, Header2 should be renamed to Header55.

Note2

[[Note1#Header1]]
[[Note1#Header1#Header55]]

Actual result

When renaming Header1, only the link with the non-nested Header1 is renamed.

Note2

[[Note1#Header99]]
[[Note1#Header1#Header2]]

When renaming Header2, nothing changes.

Note2

[[Note1#Header1]]
[[Note1#Header1#Header2]]

Environment

SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.8.9
Operating system: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 24.5.0
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

It is surprising that this doesn’t work. The Obsidian docs show that links to subheadings is valid syntax, see “Linking to subheadings”. Excerpt from the docs:

Linking to subheadings

You can add multiple hash symbols for each subheading.

For example, [[Help and support#Questions and advice#Report bugs and request features]] will create a link to Help and support > Questions and advice > Report bugs and request features.

Reproduced in a new vault with no community plugins enabled and no extra CSS.