This rule has been discussed a lot over the years. It should be modified IMO.
Here is a good article about it.
https://www.theringer.com/nfl/2017/11/15/16653504/fumble-turned-touchback-rule-change-suggestions
Ball security logic would be that any O player fumbling out of bounce (even in the field of play between the end zones) then
should go to the D, right?
The safety rule is so players don't "purposely" fumble out of bounce.
I agree with that rule.