These しまう doesn't mean the same.
何故気にしてしまうのですか。= Why do you end up caring (/minding)? (though you don't have to do that)
This ~てしまう means "end up ~ing", "find oneself ~ing", "can't help ~ing", "against one's will", etc.
昼ごはんまでにレポートを書いてしまう。
漢字の宿題はもうやってしまった。
These しまう are one of the uses of "perfect". (the first one is "future perfect" and the second one is "past perfect / pretérito perfecto") It is used for something that will have/ has/ had been finished.
昼ごはんまでにレポートを書いてしまう。
= I will have finished writing the report until lunch. (If it expresses only ones will, it would be, simply, "I will finish .... ".)
(Como "habré terminado..." o "terminaré ... ")
漢字の宿題はもうやってしまった。= I've already finished my homework of kanji.
(Como "ya he terminado...")
I hope this was helpful.