Richard says that if he buys Fox Hole app from Gavin that would prevent Maximo from buying more shares of his company and Gavin adds that it would force him to sell any shares he already owns which becomes Richard's new main plan but it makes no sense and there is no factual basis for this. There is no logical or legal reason for Maximo to be forced to sell his Pied Piper shares in this situation.
A major acquisition like Piped Piper buying out Hooli would have to be approved by not only Hooli's board but also boards of both companies as well as shareholders of both companies. Since it was revealed that Maximo owns 30% of Pied Piper, the deal would struggle to get passed by Pied Piper's shareholders not to mention crash Pied Piper's stock price since they would be absorbing a struggling business and the deal would have failed.
Pied Piper buying Hooli wouldn't really solve any of its problems. It certainly wouldn't keep Maximo Reyes from buying more shares of Pied Piped. The whole scheme Richard ran in order to keep Maximo from buying his company was pointless and made no sense from a financial perspective.