I think there is a difference between applying your skills to making money as a coder or engineer, and trying to do the same as a gambler. Although luck is a factor everywhere, even in coding, the percentages differ big time. Imo, only 1%-2% depends on luck in a normal profession, meaning you might fail in 1 or 2 in a hundred of your works, while in sports betting, it's hard to achieve such rate of success.
I doubt you could consider luck in coding? That is unless you're just fiddling around the codes and somehow managed to make it work, then that is indeed luck but it shouldn't be normally applied since coding requires knowledge and that can't really betray you, or for any other knowledge-based work out there. Sports betting has knowledge used as well, yes, but the difference is you're basically judging others instead of yourself, which makes it a lot more difficult to actually achieve a result. It's like the difference between knowing how to create your own house vs asking someone who knows how to create a house, the former being you know what to do, the latter being you can only leave it up to someone you "THINK" can do it.
So, we agree on the main point here: luck plays much lesser role in a knowledge-based work than in sports betting, although sports betting is also, at least partially, a knowledge-based work.
Now let me explain what I mean by saying that even in coding luck is a factor. Of course I don't mean that someone can wright a good code with the help of luck. If you have little knowledge, the probability of creating something worthy by just fiddling around the codes is zero. BUT, if you are a good coder, you can still be affected by
bad luck, in a sense that finding a good job can take much more time than needed on average.