You were right to penalise the foul. The late challenge is a more serious offense than the offside, and when there are two offenses committed at the same time you penalise the more serious.
You're confusing things a bit here.
When there are two fouls committed by the
same team, you penalize the most serious. When there are things for either team, you penalize the first.
My reading of the situation is that the player in offside position was interfering with play by impacting/interfering with the defender, forcing the defender to make the poor tackle.
Based on that, offside is the thing that stops the play, so IFK for the defensive team, but a caution for the reckless tackle (by description) to the defender.
If the defender tackled the player in offside position, but the ball was "not near them" at the time, then penalizing the play with a direct free kick to the attacking team is the right thing to do.
If you'd already stopped play before the challenge came in it could well be a red card rather than a yellow (obviously depending upon the relative distances / times / force involved), because a player putting in a hard challenge on an opponent who doesn't have the ball is asking to be sent off for excessive force. The opponent would not be expecting the challenge so it would hurt more.
If a tackle is reckless if the ball is in play, it's still reckless if the ball is not in play. Don't confuse what the opponent is expecting and where the ball is with what the level of force involved is. There are fairly well defined definitions of each level of force in the Laws, and those don't change if the ball is not in play.
Since the ball is not involved it would probably be VC rather than SFP.
To be more precise, the play has been stopped in this case.
You should generally avoid use of advantage when the offender is being cautioned, so even if the attacker hadn't been offside you should probably still have stopped play to caution the player. In that case the roles would have been reversed, with the defending team being happy with you but the attacking team not so!
Again, some confusion here -- avoid use of advantage when you're sending someone off (unless the ball is literally going into the goal). For cautions, it's fine -- just communicate. For example, in this case, if the attacker was not offside and was in alone on the GK, just use something like "#4, I'm coming back for you... play on, advantage!"