Heteroskedastic probit estimation with a factor variable gives (slightly) different results than with equivalent 0-1 indicator variables. Differences arise in coefficient estimates, log likelihood, and homoskedasticity test chi2. This is in Stata 16.1.

A factor variable named w equals 0, 1, 2, or 3, so it can be used in estimation with i.w , or with the equivalent indicator variables w1 = (w==1) , w2 = (w==2), and w3 = (w==3) . A binary outcome is y, and another continuous variable is x. I estimate:
Code:
hetprobit y x i.w, het(x i.w)
I then replace the first usage of i.w with the equivalent indicator variables:
Code:
hetprobit y x w1 w2 w3, het(x i.w)
The estimates converge slightly differently in the two different cases. I am using Stata MP 16.1 revision 8 Jul 2021 on Mac.

The difference happens for i.w in the main term, but seemingly not in the heteroskedasticity term. Putting "set seed 58233" just before both calls to hetprobit does not make the results the same (and indeed the results of hetprobit do not seem to depend on random numbers). Probit models without the heteroskedasticity term seem to converge to the same result regardless whether "i.w" or "w1 w2 w3" is used; I'm only seeing a difference for hetprobit.

Does anyone see a reason why this would happen?

Below I show contiguous Stata output that (1) documents key aspects of the data, and (2) demonstrates the difference in estimates. I've suppressed the ML logs with nolog options, but the iterations show 70 full model iterations using "i.w" versus 65 using "w1 w2 w3" and with "(not concave)" displayed at different iteration numbers. As I said the differences are small, but noticeable.

Code:
. di _N
250

. su , sep(0)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
           y |        250        .288    .4537395          0          1
           x |        250    4.441809    .7600443   .8457781   5.457211
           w |        250        .928    1.057967          0          3
          w1 |        250        .144     .351794          0          1
          w2 |        250         .26    .4395142          0          1
          w3 |        250        .088    .2838632          0          1

. tab w, mi

          w |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        127       50.80       50.80
          1 |         36       14.40       65.20
          2 |         65       26.00       91.20
          3 |         22        8.80      100.00
------------+-----------------------------------
      Total |        250      100.00

. assert w1==(w==1) & w2==(w==2) & w3==(w==3)  // The omitted category is w==0.

. hetprobit y x i.w, het(x i.w) nolog

Heteroskedastic probit model                    Number of obs     =        250
                                                Zero outcomes     =        178
                                                Nonzero outcomes  =         72

                                                Wald chi2(4)      =       1.97
Log likelihood = -106.9522                      Prob > chi2       =     0.7413

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
y            |
           x |   .4855019   .7097267     0.68   0.494    -.9055368    1.876541
             |
           w |
          1  |     3.1424   4.608419     0.68   0.495    -5.889936    12.17473
          2  |   3.590161   4.310631     0.83   0.405    -4.858521    12.03884
          3  |  -2234.108   24823.36    -0.09   0.928       -50887    46418.78
             |
       _cons |  -5.399992   3.985377    -1.35   0.175    -13.21119    2.411204
-------------+----------------------------------------------------------------
lnsigma      |
           x |   .2204246   .3146317     0.70   0.484    -.3962421    .8370914
             |
           w |
          1  |  -1.411461   2.456378    -0.57   0.566    -6.225874    3.402952
          2  |  -1.073397   2.581648    -0.42   0.678    -6.133333     3.98654
          3  |   6.172341   11.19192     0.55   0.581    -15.76341    28.10809
------------------------------------------------------------------------------
LR test of lnsigma=0: chi2(4) = 1.86                      Prob > chi2 = 0.7616

. di %16.15g e(ll)
-106.95224858907

. hetprobit y x w1 w2 w3, het(x i.w) nolog

Heteroskedastic probit model                    Number of obs     =        250
                                                Zero outcomes     =        178
                                                Nonzero outcomes  =         72

                                                Wald chi2(4)      =       1.97
Log likelihood = -106.9523                      Prob > chi2       =     0.7415

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
y            |
           x |   .4854962     .70974     0.68   0.494    -.9055687    1.876561
          w1 |   3.142395    4.60851     0.68   0.495    -5.890119    12.17491
          w2 |   3.590151   4.310695     0.83   0.405    -4.858656    12.03896
          w3 |  -2148.256   24828.55    -0.09   0.931    -50811.32    46514.81
       _cons |  -5.399961   3.985342    -1.35   0.175    -13.21109    2.411167
-------------+----------------------------------------------------------------
lnsigma      |
           x |   .2204242   .3146381     0.70   0.484    -.3962551    .8371035
             |
           w |
          1  |  -1.411471   2.456464    -0.57   0.566    -6.226051    3.403109
          2  |  -1.073407   2.581738    -0.42   0.678     -6.13352    3.986707
          3  |   6.133164   11.63331     0.53   0.598     -16.6677    28.93402
------------------------------------------------------------------------------
LR test of lnsigma=0: chi2(4) = 1.86                      Prob > chi2 = 0.7616

. di %16.15g e(ll)
-106.95225620844