You will need to pass it in a different way, the way i read that code your just passing 2 as nothing. To nothing. It needs to check the value if it exisits etc.
{$invoice->$cfieldsValues()['field_2']}
I be more then happy to try help you @Argyros but i would need to see more of the code or understand what you are trying to achive ?
Where is the data coming from, is it fields etc from a page or ?