I think the problem is in your equivocal use of the term "function of". A function is something that assigns each value in its domain a value in its range (where the domain may consist of tuples of values if the function takes several arguments). Now by "$\phi(f,g)$ is some function of $f(t),g(t)$" one might mean one of three quite different things:
- $\phi$ assigns a real value to any two functions $f$ and $g$.
- $\phi$ assigns a real value to any two real values $f$ and $g$.
- $\phi$ assigns a real value to any real value $t$, which is computed by substituting $f(t)$ and $g(t)$ into a formula $\phi(f,g)$.
In the first case, $\phi$ is usually called a functional, and one considers its variation $\delta\phi$. In the second case, $\phi$ is a function of two real arguments, and one considers its partial derivatives $\partial\phi/\partial f$ and $\partial\phi/\partial g$. In the third case, $\phi$ is a function of one real argument, and one considers its total derivative $\mathrm d\phi/\mathrm dt$.
You're mixing up cases 2 and 3. In variational calculus, F(x,y,y') is considered as a function of three variables, and then of course its partial derivative with respect to the first of those arguments is $0$ if its value is given by the second argument. Here $y$ is not being considered as a function of $x$, but as one of three arguments of $F$.
When we form an integral like \int F(x,y(x),y'(x))\mathrm dx, we do consider the integrand as a function of $x$, but that doesn't mean we consider $F$ as a function of $x$. Likewise, we can form the total derivative of the expression F(x,y(x),y'(x)) with respect to $x$, but that doesn't make $F$ a function of $x$. You might read things like "thus we can consider $F$ as a function of $x$", possibly in conjunction with somewhat confusing notation like $\mathrm dF/\mathrm dx$, but then a different function $F(x)$ is being considered, a function of one real argument which assigns to each real value $x$ the value F(x,y(x),y'(x)), and this function of one argument is not the function F(x,y,y') of three arguments; in particular it's not the function we're talking about when we form $\partial F/\partial x$.