So both of your two examples are legal as intended. Peter's is a somewhat complex set of facts and I have some sympathy with the inability to legislate specifically for every variation of facts.
This indeed can get very messy. What if A and B are in fact parents of the child but have divorced, and they decide to split the costs three ways with A paying 1/3 and B paying 2/3?
I think the company one is relatively easy if it is a limited company - the plane belongs to the company not the individual. May be more complicated if it is a sole entrepreneur type of outfit.
If A and B are both pilots would that change anything? If A invites B to go along on a flight (A pays 100%), but then A says "B, Why don't you take controls for a while?" would B then be breaking the rules of the ANO? He is flying but is not paying after all.
Golf-Sierra