I have that rosemary tends to have deep roots. Mine in the yard may have roots to China! When I put one in a container I try for tall almost more than wide. You might try a larger container (with good drain holes) fresh dirt and re-pot. I use something less rich and wet than Miracle Grow potting mix. It needs some nourishment, but not like for some other plants.
I am forever starting new plants. Guess I fear for the huge one in the yard, and just because they are so pretty and tempting at the garden center. (yes, admit to a problem here!) I put one new one, good sized 8" start in a very larger tub last spring. 18" or so, the kind large shrubs come in. It didn't do much all summer, just waited out the winter. This spring putting on new growth. A couple weeks ago I freshened the top 6" or so of soil, added more, cleaned up etc. It is kickin' in now! Looks to be adding roots, perhaps where a lower branch is now down in the dirt. The one I babied inside (smaller pot) I potted up to 10" pot and it said Thanks, Finally! I think there is another one I just potted up also in a pot deeper than wide. Then there is the sprawly one that seems to be kicking in this season with fresh dirt and cleaning. (Did I say I had a problem here?!)
By outside in the ground rosemary seems to be migrating. With pruners and loppers cut off dead from one side, but it seems to be spreading on the other. I think it is putting down roots where branches hung low on the ground.
On rosemary, we have a big pretty one in the herb garden at Ft Toulouse (AL). I was there this past wkd cleaning up. I hit the rosemary with my pruning clippers trying to clean it up. The fellow doing some cooking for us for lunch asked me to pass him some rosemary springs, so brought him whole branches!