"Why did I say that?"
Переклад:Чому я сказав це?
That is generally the case. However, it is possible to say something like, "What did I say this?" It sounds like something a professor would say in a lecture about an academic idea he or she has just put forth. The "this" then is giving the indication that the referenced idea is sill very much in recent memory of the speaker and audience. If it was an idea mentioned in the last class period, then "that" is, indeed, almost certain to be used, and in day-to-day conversation, the situation is by and large as you say.
This matter being relevant in a quite elevated language register, I would not object to Duolingo not accepting it: far more important for learners to understand that "that" is almost universally the right choice.