But on the other hand there are Euler's relations, following from the extensivity of ##U## and its "natural independent thermodynamical quantities", ##S## and ##V## (discussing the most simple case of a gas with a fixed number of particles). So we have
$$U(\lambda S,\lambda V)=\lambda U(S,V).$$
Take the drivative of this equation wrt. to ##\lambda## and set ##\lambda=1## you get
$$S \partial_S U + V \partial_V U=U.$$
On the other hand
$$\mathrm{d}U=\mathrm{d} S T - \mathrm{d} V P,$$
from which indeed
$$T=\partial_S U, \quad P=-\partial_V U.$$
From that
$$U=ST-PV.$$
The complete Legendre transform which eliminates all extensive variables must lead to 0, and indeed
$$G=U-ST+PV=0.$$
The free enthalpy (Gibbs potential) is only non-trivial if you have more extensive variables, e.g., the particle number. Then the internal energy is
$$U=U(S,V,N)$$
and
$$\mathrm{d} U=T \mathrm{d} S - P \mathrm{d} V + \mu \mathrm{d}N,$$
where we have an additional intensive variable is the chemical potential ##\mu##. Then the Euler relation reads
$$U=ST-PV+\mu N,$$
and the Gibbs potential is
$$G=\mu N \neq 0.$$
Now to the original posting #1. One has to be aware which are the "natural independent variables" for the used thermodynamic potential. Then no problems occur:
With the same technique you also prove the relation for the enthalpy
$$H=U+P V.$$
From
$$\mathrm{d} H=\mathrm{d} U + \mathrm{d} P V+V \mathrm{d} P = \mathrm{d} S T + \mathrm{d} P V$$
you see that the natural independent variables for ##H## are ##S## and ##P## and
$$\partial_S H=T, \quad \partial_P H=V.$$
Now from the extensivity of ##S## and the intensivity of ##P## you have
$$H(\lambda S,P)=\lambda H(S,P).$$
Taking the derivative of this equation wrt. ##\lambda## and then setting ##\lambda=1## you get
$$H(S,P)=S T(S,P).$$
So you have
$$\mathrm{d} H=T \mathrm{d} S + S \mathrm{d} T, \qquad (1)$$
but to find the original relation you need to consider ##T## as a function of ##S## and ##P##. Since ##T## is intensive we have
$$T(\lambda S,P)=T(S,P)$$
Taking the derivative wrt. ##\lambda## and then setting ##\lambda=1## yields
$$\partial_S T(S,P)=0.$$
From this you get
$$\mathrm{d} H=T \mathrm{d} S + \mathrm{d} P S \partial_P T(S,P). \qquad (2)$$
But now
$$T(S,P)=\partial_S H(S,P) \; \Rightarrow \; \partial_P T(S,P)=\partial_P \partial_S H(S,P) = \partial_S \partial_P H(S,P)=\partial_S V(S,P). \qquad (3)$$
Since now ##V## is extensive we have
$$V(\lambda S,P)=\lambda V(S,P).$$
Once more the trick with the ##\lambda## derivative yields
$$V(S,P)=S \partial_S V(S,P).$$
Now using (3) in (2) and then this relation we get
$$\mathrm{d} H = T \mathrm{d} S + \mathrm{d} P S \partial_S V=T \mathrm{d} S+ \mathrm{d} P V.$$
So the important point is to keep in mind which are the "natural independent variables" for a used potential. Then you get no contradictions in the formalism with the Legendre transformations and the Euler relations.
That's also, why it's important to keep in mind which variables are held fixed in the Euler relations. E.g., you have
$$T=\partial_S U(S,V)$$
and
$$T=\partial_S H(S,P),$$
but you get ##T## as a function of different other thermodynamical variables using the different potentials.
To emphasize which variables are to be held constant in the partial derivatives in Maxwell relations one often writes the above relations
$$T = \left (\frac{\partial U}{\partial S} \right)_V=\left (\frac{\partial H}{\partial{S} \right)_{P},$$
i.e., you indicate with a subscript which other independent variable has to be kept fixed.
All this can of course extended if you consider systems with more independent variables, as if there is one or several particle numbers additional independent variables.