That’s not quite how it went down, IBM did not sell DOS to Microsoft, in fact Microsoft bought DOS from a company called Seattle Computer Systems, renamed the OS to MS-DOS and licensed it to IBM instead of selling it, changing the way software was bought and sold.
I believe Gerstner was still at IBM when they began a foolish adventure to develop their own OS for the PC called OS/2, they spent millions developing the product and it never really caught on and was eventually dropped.
The decision to license DOS from Gates/Microsoft and the decision to develop OS/2 in an attempt to make an alternative to DOS were both made long before Gerstner was on board at IBM.