If the licensed code was written by a patent licensee, then to replicate it in-house you’d also need to license the patent yourself.
In other words, the patent licensee may have a license to write and distribute their specific piece of software, but not to sublicense that to other people to write their own software, just to use the parent company's patent license. That is actually probably a common patent-license scenario, microsoft doesn't automatically get sublicensing rights just because they bought software developed by a licensee.