I’m not sure if you’ve surmised this, but the bolded portion means for some reason (or another).
Here’s my pathetic effort to explain it literally,
どうした what happened
わけ reason
And か makes “the reason why it happened” uncertain.
In any event, @seanblue and @jstrout are on the right track using the context to make sense of the girl’s apology: she was putting on airs to seem like she was more worldly, adult-like, etc., when in reality she wasn’t. I think the point of the chapter was to show how Kiki allowed a personal rivalry to challenge her personal beliefs.
I actually asked a friend about this a while ago, he told me that he had no idea, except that it a was probably a play on words to personify the hat. Beyond that, he couldn’t really understand the word choice. The best logic I could think of is how some animal sounds are not really the sounds they make, but the actions they do (e.g., rabbits go ピョンピョン “hop-hop”)
I think you’re on to something as that をじゃまにする can mean to be a bother. The only thing that made me think otherwise was that in previous points in quoted dialogue (specifically in the last line ending the quote) a question mark is included in contrast to statements that don’t include periods. I amend my initial interpretation and defer to “Am I bothering you (by being here)?” because it makes a little more sense based on Jiji’s confusion about why Kiki’s motives.








So I’m not convinced it might help here either.


