NC Columnstore and delete on batch hope you can give me some pointers on this behavior

I have a NC Columnstore and in the same batch I want to drop this column store and "delete" some information.

But I get this error:
DELETE statement failed because data cannot be updated in a table with a columnstore index. Consider disabling the columnstore index before issuing the DELETE statement, then rebuilding the columnstore index after DELETE is complete.

For what I can image this is due to the compilation throwing the error.
In the end i used the OPTION(RECOMPILE) at the end it worked for the scenario I was facing, but bear in mind that this won't work for parameters.