I enable the company to make a $50 profit, the value of my work is the portion of that $50 attributable to my work.
You forgot to multiply by the number of widgets.
But yes, the value of your work is the portion of the revenue (not profit) that your work produces. Sometimes this number is easy to calculate other times it's extremely hard or impossible to calculate so it gets estimated with a very, very rough guess.
And if the amount of revenue is less than the cost of all the materials and labor, why even produce the widgets at all? If the company is not making a profit, why would the owners of the company not change the business or shut it down. Running a business that keeps losing money just doesn't make sense. And there do exist non-profit businesses, but they still try to make a bit of money and are at risk of going out of business if they lose money for a while and didn't have enough profit saved up to cover the losses.
Similarly, if you want more money to assemble widgets than what anyone is willing to pay for those widgets, why are you assembling them?
Every single person in the world routinely makes choices to not buy things they think are too expensive. Why should labor be any different? The people running companies choose not to hire people, or to lay people off, if the work those people would do is worth less than the paycheck those people require in order to do the work. This is no different than you walking into a store and choosing not to buy an item off the shelf because you think the price is too high. You could buy it, but then you'd have less money to spend on other things that you'd prefer to spend it on. The buyer decides how much they want to pay and if it's less than the seller will sell for, the buyer walks away. That's all layoffs are, the buyer (company) deciding they would rather spend money else because the price the seller (employee) is asking is higher than the buyer thinks it's worth.
It's not just companies. Everybody wants to get more stuff for less. That's why you want more pay for less work and it's why you buy less expensive stuff when you could pay more for the same thing. You just view it differently when it's you wanting more for less than when your employer wants the same thing.