No, what you’re saying is correct. If the inverse square law was obeyed perfectly, space would be restricted to 3-spatial dimensions.
The extra spatial dimensions are usually theorized to be extremely compact so the effects of a higher power law (the inverse square law can be generalised to 1/r^(n-1) with n as your amount of dimensions.) can be neglected.
Of course, to prove it you’d have to at some point measure these effects, and there is some evidence that the inverse square law breaks down. (https://arxiv.org/pdf/hep-ph/0307284.pdf)