Garbage time is when normal substitution rules don't apply, hence, your situation. While you may wonder why a player played out of position, it is clear that the reasons for that are not in the normal substitution rules, but in the basic implementation of garbage time. I agree that it is not perfect and that in this situation the substitution pattern could be better but it is a well known fact that in garbage time, anything goes. We haven't touched it and there have been no changes to this particular piece of code since way back when so it should come as no real surprise for a 25 season veteran that this happens.
Another thing is that you are trying to separate this issue from the 48min per match situation, but that's impossible. These two issues are in this case very much connected since you were trying to get 4 players the 48 minutes. Therefore, if you hadn't done that, the other issue wouldn't become an issue at all.