Template not working while creating object

Hello Team,

I have a custom attribute in person record for which I have created template code and checked overwrites(V8).

Template code is not working while object is being created but reexecute template is giving correct result.

Am I missing anything here while object is getting created and what was the reason of template being not called.