You’re absolutely correct that either the present tense or past tense can be used for that sentence, but the context will be different for each construction. The past-tense “What I did was a mistake” is appropriate if the statement was made in retrospect by the writer or speaker, with the realization of the mistake having definitely occurred in the past and not right before the moment of speaking or writing about it. On the other hand, the present-tense “What I did is a mistake” is appropriate if the statement is made at present or at the very moment of speaking, with the realization of the mistake having just sunk in; in this case, the sense of “What I did is a mistake” is precisely the same as that of “I made a mistake” as a spur-of-the-moment remark.