He overstayed the original date of his H1-B visa, but was allowed to continue to work for an additional 240 days while his renewal application (since approved) was pending.
It seems that when his green card was denied during that period, ICE mistakenly thought he was illegally in the country either due to not checking the status of his pending renewal or by assuming his H1-B renewal was also denied.
ICE is under enormous pressure to detain and remove large numbers of people. It is exceedingly likely that this is why they "mistakenly thought he was illegally in the country." I do hope one day the people in this administration responsible for the pressure face legal consequences for the lives they've ruined.
"ICE mistakenly thought"
Sure.
I think the missing information is why his I-140 was stamped “automatic revocation”.
That means it was approved then revoked for some reason - they don’t normally do that.
It could be his employer eithdrew the application or they think there is fraud.
Way more to this story