You can't generally just assign one arbitrary data type to another. For example, the following is also invalid:
TemporaryCustomObj value = new CustomObj__c();
What you need to do is to translate the ...
There a few issues with this code:
You are appending to the loop while looping through it. This will cause a run-time error.
You have your for loop setup wrongly - it won't iterate at all like this.