CDR (userfield) is empty

Good day to all!
Asterisk 13.18. There is a task to write $ {HANGUPCAUSE} in CDR (userfield), everything seems to be simple, but with the construction below $ {HANGUPCAUSE} is written in CDR only if the connection is established, if it is busy, unavailable, etc. in the CDR (userfield) is empty. In the console everything is ok - there are no errors. Any ideas on this ??

Here is an example of a dialplan:
exten => _7XXXXXXXXXX, 1, NoOp ()
same => n, Dial (SIP / $ {EXTEN} @ multifon-out, 30)
same => n, Hangup ()

exten => h, 1, NoOp (hangupcause = $ {HANGUPCAUSE})
same => n, Set (CDR (userfield) = hangupcause: $ {HANGUPCAUSE})

And noticed that if after the Dial remove the same => n, Hangup (), $ {HANGUPCAUSE} is written to the CDR (userfield) in any case, but this same => n, Hangup () is very necessary. Thank you very much in advance!