Both sources you link to say Allen and Gates pulled listings of the PDP-10 operating system out (probably DEC's TOPS-10?) of the trash. BASIC is not an operating system. So your claim is debunked by your own sources.
"...digging out the operating system listings from the trash and studying those. Really not just banging away to find bugs like monkeys[laughs], but actually studying the code to see what was wrong."
https://americanhistory.si.edu/comphist/gates.htm
"...He and Bill would go “dumpster diving” in C-Cubed’s garbage to find discarded printouts with source code for the machine’s operating system..."
This is how the industry innovates
Xerox did later sue Apple for IP infringement, however most of their claims were dismissed[1].
[0] https://web.stanford.edu/dept/SUL/sites/mac/parc.html
[1] https://arlingtonmnnews.com/articles/bits-and-bytes/xerox-ve...
> [0] https://web.stanford.edu/dept/SUL/sites/mac/parc.html
I searched the cite for the 'share', '10', '22', 'sold, 'sell', 'bought', 'buy', 'purchase', and found nothing. ?
Exactly how and when Xerox disposed of its shares is not public record, but it's known to be around that timeframe and certainly Xerox made a profit. The book _Dealers of Lightning_ goes into more detail about the deal if you're interested[1].
[0] https://www.cnbc.com/2018/05/21/why-your-computer-has-a-mous...
[1] https://www.goodreads.com/book/show/1101290.Dealers_of_Light...