I have two sets of code as below, I am wondering what are the differences between these two sets of codes:

The panel data has two dimensions: TYPE2(firms) and yr(year)
pt is a binary variable (receiving value 0 or 1)


Set of code1 (reg command):

Code:
** Begin Manual 2SDiD
* Step 1: Manually (note standard errors are off)
reg l_homicide i.sid i.year [aweight=popwt] if post == 0

* Step 2: Regress transformed outcome onto treatment status for all units
predict adj, residuals
reg adj i.post [aweight=popwt], vce(cluster sid) nocons
result:* 1.post .075

Set of code 2:

Code:
reghdfe l_homicide [aweight=popwt] if post == 0, a(sid year) res(adj1)

reghdfe adj1 post [aweight=popwt] ,noabsorb nocons vce(cluster sid)
Result: omitted variable


What are the difference between these two set of codes when running on a panel dataset?
Thanks and warm regards.