I would say the microbiome is outside the body in the sense that it is the bugs (viruses, bacteria etc) that live alongside us but are not within the cells of any organ or the blood or fluid between the cells.
It's mostly in the gut, but also on the skin and in every body cavity, eg mouth etc. Since the gut is open at both ends, the contents of it are effectively outside the body unless they penetrate into or between the cells of the gut wall.
If the bugs get into any cell or organ they are no longer microbiome, but an infection that the immune system needs to deal with.
Edit: which doesn't actually answer your question! I would say if it's a gut infection, then gastroenterology, if it's a knock on effect of something produced by the microbiome that gets into the bloodstream and causes problems with a particular system of the body, then it would have to be that specialism that deals with it.