I suppose the main issue here from a legal perspective is the definition of a goal that can even be verified externally in case of disagreement, for instance by a judge. Hours of presence, on the other side, are quite objectively measurable (although becoming harder in a remote-work setting).
I would like to add more subjectively: as a company, I would also be afraid that contracts defining payment based on piece work result in an army of quasi-consultants. This might push the company towards: optimize your efforts against some agreed-upon metrics (see the previous point about goals), and go home. I suppose there is some benefit for a (software) company if its employees spend time at work "slacking" such that they might actually find useful things to do that none of their managers might ever notice.
I would like to add more subjectively: as a company, I would also be afraid that contracts defining payment based on piece work result in an army of quasi-consultants. This might push the company towards: optimize your efforts against some agreed-upon metrics (see the previous point about goals), and go home. I suppose there is some benefit for a (software) company if its employees spend time at work "slacking" such that they might actually find useful things to do that none of their managers might ever notice.