Let's assume that John gave me a cat. I can rephrase the fact with:
What John did was to give me a cat
What John did was give me a cat
What John did was, he gave me a cat
But can I say the following phrase?
What John did was gave me a cat
OK, so if no-one wiser than me out there is going to help you, I'm going to give it a go:
The complement of BE in the first example uses a so-called infinitival construction headed by to, and to is always followed by the plain form of the verb. We know therefore that this instance of the verb GIVE has no tense.
The second example has a plain form, an infinitive, although exactly why this is so is perhaps ambiguous. We can certainly show, however, that GIVE in the second example is not present tense, because it differs from GIVE in the following badly formed sentence, in that it has no inflectional third person s:
Your third example, however, differs substantially from the first and second because the complement of the verb BE, namely he gave me a cat , is a finite clause and has a subject. These two factors are not co-incidental. Firstly, finite clauses in English must have a subject (unless they are imperatives) - and secondly, only finite clauses in English have tense. The word tense is used here to mean, very specifically, that the verb in question is inflected for time reference (or for modality, or backshift). Because, in your third example, the subject from the relative clause is resumed, the verb can have a full past tense as in gave.
The very short answer to your question, then, is that your interesting fourth example is not allowable because there can be no past tense verb in the clause unless it has an expressed subject. There is no subject in the complement clause gave me a cat and so there can be no tense.
Hope this helps.