You're making an apple-to-oranges comparison between TEEs and SGX. The attacks on SGX here are on the processor/model of SGX itself. Buffer overflows are bugs in the applets that run inside the TEE. SGX applications can and do have similar bugs. Here's a random paper I found, there are many more:
https://arxiv.org/pdf/2110.06657.pdf