Question/Problem regarding Regular Expression Capturing GROUPS: "$regexp(x,e,r,c)" vs "Replace with regular expression" (ONLY available via .MTA/Quick Action)

Concerning group capture (i.e., "add 12 to $1 PM"), the two strings BELOW 100% WORKS for "Replace with regular expression" (ONLY available via .MTA/Quick Action):

Field: DATE_TIME_BACKUP
Regular expression: (?<![\d])(0?[1-9]|1[0-1])(?![\d])(?=(?:[:]\d{1,2}){2}[\W_]*PM)
Replace matches with: $add($1,12)

Field: DATE_TIME_BACKUP
Regular expression: (?<![\d])(0?[1-9]|1[0-2])((?:[:]\d{1,2}){2}[\W_]*)([AP]M)(?![\d])
Replace matches with: $if($eql($1,12),$if($eql($3,am),$sub($1,12),$1),$if($eql($3,am),$1,$add($1,12)))$2$3

However, the two strings, BELOW, 100% FAILS when using "$regexp(x,e,r,c)", regarding group capture (i.e., "add 12 to $1 PM"):

$regexp(%date_time_backup%,'(?<![\d])(0?[1-9]|1[0-1])(?![\d])(?=(?:[:]\d{1,2}){2}[\W_]*PM)',$add($1,12),1)

$regexp(%date_time_backup%,'(?<![\d])(0?[1-9]|1[0-2])((?:[:]\d{1,2}){2}[\W_]*)([AP]M)(?![\d])',$if($eql($1,12),$if($eql($3,am),$sub($1,12),$1),$if($eql($3,am),$1,$add($1,12)))$2$3,1)

I was wondering, when searching (?<![\d])(0?[1-9]|1[0-1])(?![\d])(?=(?:[:]\d{1,2}){2}[\W_]*PM), why does the group replacement, $add($1,12), FAIL when I use $regexp(x,e,r,c), but 100% WORKS when I use Replace with regular expression? Moreover, if I use Replace with regular expression and search for (?<![\d])(0?[1-9]|1[0-2])((?:[:]\d{1,2}){2}[\W_]*)([AP]M)(?![\d]), the Replace with regular expression allows me to replace with "$if($eql($1,12),$if($eql($3,am),$sub($1,12),$1),$if($eql($3,am),$1,$add($1,12)))$2$3". Basically, concerning the use of $regexp(x,e,r,c), my problem is why does the string, $regexp(%date_time_backup%,'(?<![\d])(0?[1-9]|1[0-1])(?![\d])(?=(?:[:]\d{1,2}){2}[\W_]*PM)',$add($1,12),1) FAIL to add 12 to $1 PM? Nevertheless, my only alternative was to use my 2022 string, $regexp(%date_time_backup%,'(?<![\d])(0?[1-9]|1[0-1])(?![\d])(?=(?:[:]\d{1,2}){2}[\W_]*PM)',$add($regexp(%date_time_backup%,'^.*(?<![\d])(0?[1-9]|1[0-1]):(\d{1,2}:\d{1,2})(?![\d]).*$',$1),12),1), for it to add 12 to PM"?

Therefore, I was wondering how can I make the scripting function $regexp(x,e,r,c) work the SAME way as Replace with regular expression? Is there something that I am missing on my end in order to replace with capturing groups with another scripting function, such as $add(x,y) ~ $add($1,12) when using $regexp(x,e,r,c)?

See here:

Hmmm interesting. Thank you. Moreover, I wish, in the near future, that issue could be fixed because you can use $regexp(x,e,r,c) anywhere in Mp3Tag (i.e., .MTA, .MTE, columns.ini, tools.ini, Actions {Quick}, etc), while you can ONLY use Replace with regular expression in .MTA and Actions (Quick). Nonetheless, thanks again for the quick response.

I am not sure what should be fixed - AFAI see it, the scripting statement only has to be set according to the underlying function, which means that you first have to extract the string (in this case a number) and then use that for further treatment.
It does not work to manipulate the result string directly - which you know by now.
Your original string followed that approach. So you will reach your goal in the end.