rbynaker
Level 13

Sounds like there's a lot going on so you need to step through the transactions one at a time.  When A bought out B in 2020 there likely ceased to be a partnership (unless there's something you're not telling us).  While there are no technical terminations anymore, it sounds like this was an actual termination of the partnership when there ceased to be more than one partner.

Once you figure that out, figure out what the remaining owner purchased.  Were assets undervalued?  Were there intangibles?

Then when the disregarded-entity (single-member LLC) elects to be treated as an S Corp it's a contribution of assets to the S Corp from the owner.