You see in the sample code you have posted- at Line 2 - tempClob is null and its initialized only in the try block. But when its being used in the catch block it may be or may not be initialized.
May be because- CLOB.createTemporary successfully executes.
May not be because- there was some exception while executing CLOB.createTemporary and hence tempClob is not initialized.
So in you catch you need to check if tempClob is initialized before you execute tasks of cleaning.