@sshn
I see what you’re talking about.
In the “Sicut locutus est” example you cite, Bach has chosen to force a kind of tonal answer (where a degree of the scale is altered) because it works well for what he was trying to do, I believe. As I understand it, tonal answers are only mandatory (if that’s even the right word to use) when the fifth degree of the scale is present near the beginning of a subject; for example, if the subject (in C major) is C G E C, then the answer would be G C B G, rather than G D B G. Does that make sense? Otherwise, I believe tonal answers are discretionary.
Tonal answers and the rules governing them are the source of a lot of confusion. In the Fugue Crash Course I wrote and posted here many years ago (on the unlikely but very familiar subject Ah! vous dirai-je, maman, or “Twinkle, twinkle Little Star”), ideally, I should have done a tonal answer since there is blatantly a fifth degree of the scale near the beginning of the subject; but my purpose was to illustrate the basics of fugue writing, so I left the subject alone so as not to cause a lot of confusion. I may rewrite the exposition with a tonal answer someday though, just to be correct.
In the case of your subject, I don’t immediately see that you have any choice but to write a codetta to modulate back to the tonic in the answer. I’m almost certain you don’t have to write a tonal answer, and It seems to me that a forced tonal answer would adversely affect the integrity of the subject in this case. Just my opinion, but that’s how it looks to me. Let me know if you have any questions, and by all means, if anybody else has a different understanding on the practice of tonal answers, let it be known!