I expect that occurs because the normal use of hash at the start of a line is for a heading …
… like this one
In markdown #text is a heading. Commonmark has a stricter specification of # text so it is possible that this is to maintain compatibility with older markdown.
To avoid the problem, which is not very common, I just put a space before the hash so autocomplete works.
If I mistakenly, out of habit, put the space before a heading then the heading will still work, e.g.: