As you can see my indent setting set to 2 spaces

But the inserted table of content wants to put 3 spaces

It seems that the default indent size is taken into account, and not the current indent size
note that I'm using the editorconfig extension with this config
[*.md]
indent_style = space
indent_size = 2