This proof cannot work since then every two maps $X \to Y$, where $Y$ is path-connected, are homotopic - which is false. On the other hand, if $Y$ is contractible, then every map $X \to Y$ is homotopic to a constant map (since this true for the identity $X \to X$), thus every two maps $X \to Y$ are homotopic. Even if $Y$ is contractible, in your proof the paths $P_x$ may be choosen so arbitrarily that $F$ is not continuous. Indeed, there are maps $F : [0,1] \times [0,1] \to \mathbb{R}$ such that $F(-,0)$, $F(-,1)$ and all $F(t,-)$ are continuous, but $F$ is not.