Let's start with different scenarios that you could analyse. Work is, as you say, displacement times force in the direction of displacement. In the simplest scenario, where you have a nonvarying force and a nonvarying direction, this amounts to
$$ W=F\cdot s$$
If you consider two different scenarios, each with a work and a force, you have the calculations $W_1=F_1\cdot s_1$ and $W_2=F_2\cdot s_2$. Now, in principle, you could choose whatever paths and whatever forces you want - you could even try to fix $W_1$ or $W_2$ and see which paths lead to this answer. This gives you a number of different scenarios that you could analyse and I'll write down most of them:
- You fix work, consider two different forces and then consider paths.
- You fix paths and consider two different forces.
- You fix paths and work done and see which forces can be applied to obtain the work on the given path.
- You fix force and work and see which different paths can be taken.
- You fix the force and consider different paths.
- You fix the force and consider different paths between the same points.
Examples and Elaboration:
(Your) scenario: Now what you are doing is essentially a variant of the first one: You consider two different forces, $F_1$ which is upward and $F_2$ which is diagonal. You consider two different paths $s_1$ which is upward and $s_2$ which is diagonal. Now you have engineered your example in such a way that the work in both cases ($F_1$ along the path $s_1$ giving work $W_1$ and $F_2$ along the path $s_2$ giving work $W_2$) is the same. I call this "fix the work". Now what do you learn from such an example about forces and how they work? Absolutely nothing.
This is a physically nonsensical scenario. Why? When you consider work done in different force fields, there is absolutely no reason why the work should be the same - you have completely different scenarios. In fact, you can always just multiply one of the forces by some factor to make sure that the results differ. Another example? Well, let's take an arbitrary force $F_1$. It could be a field, it could be an upward force, whatever. Take an arbitrary work $F_2$, which is notably different from $F_1$. Take two paths, they could be curved, closed, whatever. Call them $s_1$ and $s_2$. Then, as you learned in the other answers, $W_1=\int F_1\cdot ds_1$ and $W_2=\int F_2\cdot ds_2$. There is no reason to expect that $W_1=W_2$ and indeed, if I randomly choose the fields and paths, this will never be the case. However, I can always multiply $F_2$ by $W_1/W_2$, creating a force $\tilde{F}_2=F_2\cdot W_1/W_2$ such that $\tilde{W}_2=W_1$. I could achieve this also by changing the paths. This is possible, because you have have an underdetermined system of equations - but it tells you absolutely nothing.
But that doesn't tell me anything, because it's hard to compare the two scenarios: It's like saying that if you go for a run in the mountains, it takes you the same amount of time as if you go to run at the lake. Oh, and by the way, you always go there by bus so the two paths start and end at different points. The two paths are completely different and it's just coincidental that you take the same time. Your time is maybe "path-independent", but only by coincidence. Maybe in winter, you suddenly take longer in the mountains because of the snow, maybe in spring, it takes longer to run around the lake, because there is a flood.
Scenarios 2 and 3: These are also not very interesting. Both of them could be reasonably applied to experimentally compare forces (the first more than the second) and if the forces are different, there is no reason to expect the work to be the same on two paths (once again, if they are the same, just multiply one force by some factor to make the work different again). From a theoretical perspective, of course, it suffices to have a look at the force field directly. In any case, these are not the scenarios when people talk about path-independence.
To give an example, you could fix a path and an object, e.g. an inclined plane of length $5m$ and inclination $45^\circ$ and you let the object slide down the plane on different surfaces (which creates different forces). By measuring the kinetic energy at the bottom, you can then calculate the work done by the friction forces. This is nice, but it has nothing to do with path-independence.
Scenario 4 and 5: These are also not very interesting. Once again, there is no reason to expect the forces to be the same if you measure work done on paths in completely different areas of the force field. For example, it takes more work to jump one metre high than it does to walk one metre horizontally if we only take gravity as our force and it's downward.
Last scenario: Finally, we have a look at the "real deal":
- You fix the force and consider different paths between the same points.
In other words: I fix a force (e.g. gravity), I fix a starting point (e.g. my basement) and an endpoint (e.g. my living room) and now I ask work has to be done to get some object (e.g. a sofa) from starting point to endpoint. The question is: Does this work depend on the path? Would it be better to go the direct way up the stairs and into the living room, or does it matter if take the detour and go via my bedroom in the second floor? If it doesn't matter, this is called path-independence. Since I always consider the same force field, I cannot simply multiply one of the forces by a factor to achieve that the work is not the same anymore. A priori, there is no reason to expect that the work done should be independent of the path I take, but it turns out that this is often the case!
This is the case if the force is convervative or in other words, if there is a potential defined everywhere and whose gradient is the force. This is the case for Newton's gravity or electromagnetism (mostly). It is however generally not the case for friction forces.
The reason why certain forces are path independent stems from the fundamental theorem of calculus: If a potential exists, integrating along a path is just the same as taking the difference of the potential at the endpoints.