Let’s break this down
自分がバカだ the fact that someone is an idiot
って気がついてないバカほど、to the degree that they('re such an idiot that they) didn’t yet realize (they are an idiot)
ばかな者はない。such an idiotic person doesn’t exist
-> there’s no idiot like one who didn’t yet realize they are one
-> only real idiots don’t get that they’re idiots
Now for the grammar:
自分がバカだって is colloquial, and the って could be anything from だって to だということ, including half-assed constructs like だってこと (which incidentally would be how i would have phrased it).
気がついてない did not yet realize
バカ THIS here is the one noun that’s been modified by everything before
ほど、and here comes “to the degree that”
ばかな者はない。“such an idiot doesn’t exist”.
Now, this was not only colloquial, this also lacked even a minimum of eloquence, it would even make a Japanese person frown. It’s just a chaotic stream of consciousness type of sentence, no wonder OP had problems comprehending it.
If i were to phrase it, I’d do it like
(and my だって here was actually just a slurred だと, no “invisible magic” to be found.