8.3.2 referencing tutto, niente, molto with prepositions
Tutto followed by quello or ciò only describes the complex referred to by ciò or quello. It is the same in English.
It turned out that all what he thought was wrong.
The relative pronoun what is just a reference (all) to a reference (what he had said).
example
Tutto ciò che pensava era sbagliato.
All what he thought was wrong.
The situation is completely different if there is a preposition. In this case ciò or quello refere to something and tutto to something else.
example
Un uomo capace di tutto per ciò che ama.
A man capable to do everything for what he loves.
Tutto refers to something, namely to all what he would do (crossing the desert, climb on the Mount Everest, kill someone etc.) for what he loves (his car, his wife, his children).
For logical reasons quello can' t be substituted by ciò, if quello is a pure demonstrative pronoun, if it is used to point to something.