The second part of your response is what I was trying to get at, jake. All offensive players have to be inside the 9 yd mark. You are also right in that the sub would not have been set for a second prior to motion. Both fouls would occur at the snap. jake, answer me this: would this be a double foul, or would the defense have to decline one foul and take the other (both are 5 yd penalties)?
And yes, the defense is OK.
Double fouls occur when there is at least one live-ball foul against
each team. Since the defense hasn't fouled, there's no double foul in this play.
Multiple fouls are two (or more) live-ball fouls against the
same team. The offense has committed two live-ball fouls (illegal formation & illegal shift), so the defense gets it's choice of which to enforce.
In this play, it doesn't matter, since both are 5-yd penalties. If the offense also had been flagged for holding, the defense would decline both 5-yd penalties and choose to enforce the 10-yrd holding penalty,
OR decline all fouls and take the result of the play.