As user @Alan Birtles pointed out, it is a bug. In the link provided by the comment, there is also a workaround:
Meanwhile, the workaround I found to this issue is to install the extension c-mantic and bind the shortcut to its "Switch Header Source". It seems to work correctly.