Unable to hide child doctype custom fields

I’m trying to hide child table Stock Entry Detail custom field based on some conditions. I have tried many methods from the discussion forums but nothing worked for me. so tried to print the object of the field in console.

in the object hidden is setting to 0 or 1 based on my code but i dont know for what reason the field is not getting hidden. object is getting edited but can see it in the console since the field is hidden by default im changing hidde: 1 to hidden: 0.

can anyone help me with this im stuck at it for a while now anything regarding this why, how, what anything at all is very helpful.

Thank you