I am trying to change an estimation stored macro with the stored result from the previous estimation. I manage to do so with `e(cmd)' but not `e(inexog)' below.

Code:
. sysuse auto, clear
(1978 Automobile Data)

. 
. qui ivreg2 price (weight=length) i.turn headroom, cluster(turn) small

. display e(inexog)
31b.turn 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn 38.turn 39.turn 40.turn 41.turn 42.t
> urn 43.turn 44.turn 45.turn 46.turn 48.turn 51.turn headroom

. local x = "`e(inexog)'"

. display "`x'"
31b.turn 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn 38.turn 39.turn 40.turn 41.turn 42.t
> urn 43.turn 44.turn 45.turn 46.turn 48.turn 51.turn headroom

. 
. cap prog drop pretend_to_be_ivreg2

. prog pretend_to_be_ivreg2, eclass
  1.         ereturn local cmd = "ivreg2"
  2.         ereturn local inexog = "`x'"
  3. end

. display "`x'"
31b.turn 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn 38.turn 39.turn 40.turn 41.turn 42.t
> urn 43.turn 44.turn 45.turn 46.turn 48.turn 51.turn headroom

. 
. qui ivreghdfe price (weight=length) headroom, absorb(turn) cluster(turn) // coeff/SE: 4.509
> 739   .7761883, Fstat: 69.125

. display e(cmd)
ivreghdfe

. display e(inexog)
headroom

. pretend_to_be_ivreg2

. display e(cmd)
ivreg2

. display e(inexog) // DOES NOT WORK
.

.
I only managed to get `e(inexog)' to output the desired list of variables when setting, within the program, ereturn local inexog = "...." (list of variable). I would like to do it automatically by making reference to a local macro, as I tried above.

Code:
. cap prog drop pretend_to_be_ivreg2

. prog pretend_to_be_ivreg2, eclass
  1.         ereturn local cmd = "ivreg2"
  2.         ereturn local inexog = "31b.turn 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn
>  38.turn 39.turn 40.turn 41.turn 42.turn 43.turn 44.turn 45.turn 46.turn 48.turn 51.turn he
> adroom"
  3. end

. qui ivreghdfe price (weight=length) headroom, absorb(turn) cluster(turn) // coeff/SE: 4.509
> 739   .7761883, Fstat: 69.125

. display e(cmd)
ivreghdfe

. display e(inexog)
headroom

. pretend_to_be_ivreg2

. display e(cmd)
ivreg2

. display e(inexog) // NOW, IT WORKS
31b.turn 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn 38.turn 39.turn 40.turn 41.turn 42.t
> urn 43.turn 44.turn 45.turn 46.turn 48.turn 51.turn headroom

.