Entropy of an expanding early universe. Why is it constant?

When one models the early universe it is most often assumed to be in thermal equilibrium i.e. the entropy is maximized and therefore constant $$dS=0$$

As far as I understand this can be explained as follows:

The change of entropy with Volume is given as: $$\frac{\partial S}{\partial V}=\frac{1}{T}\frac{\partial U}{\partial V}$$

therefore if we model a part of the early universe as a closed box of Volume $$V_0$$ with internal Energy $$U_0$$ we find $$\frac{\partial U}{\partial V}=0$$ and therefore $$\frac{\partial S}{\partial V}=0$$

i.e. as the Universe expands the entropy stays constant.

(One could also argue that a thermal equilibrium can be defined as the entropy being maximized and ignore the above...)

However, if we take a look at the Einstein equation including the cosmological constant $$\Lambda$$ $$G^{\mu\nu}=\frac{8\pi G}{c^4}T^{\mu\nu}-\Lambda g^{\mu\nu}$$ The cosmological constant is often interpreted as additional stress energy tensor i.e. we define the total tensor $$T^{'\mu\nu}=T^{\mu\nu}-\Lambda g^{\mu\nu}$$ with a new energy density $$T^{'00}=\rho-\Lambda$$ if we assume a perfect fluid with energy density $$\rho$$ Now the volume can be defined in terms of the scale paramter $$a$$ as $$V=V_0a^3$$ such that $$\rho\propto a^{-3}$$ i.e. $$\rho=\rho_0a^{-3}$$ $$\Lambda$$ however is just a constant. Therefore the overall energy $$U=\int dV\,\,T^{'00}$$ is no longer constant in $$a$$ and therefore $$dS\neq 0$$

Probably I got a mistake in this somewhere but I don't see it. I guess its either

1) my assumption taking the cosmological constant into account is not valid or

2)I got some basics of thermodynamics wrong...

I would be glad if someone could show me where my mistake(s) is(are).

The thermodynamic equilibrium requires a maximum entropy, hence $$dS = 0$$ by definition.

However in your demonstration there are inconsistencies.

The first law of thermodynamics states $$\delta Q = dU + p dV$$. If the process is reversible you have $$dS = \delta Q / T$$ and you can write $$dS = (1 / T) (dU + p dV)$$.
If we consider as state variables $$T$$ and $$V$$, we have $$dS = (\partial S / \partial T) dT + (\partial S / \partial V) dV$$. Comparing with above $$\partial S / \partial T = (1 / T) (\partial U / \partial T)$$ and $$\partial S / \partial V = (1 / T) (\partial U / \partial V + p)$$.
It is not the expression in your post.

$$T^{00} = \rho + \Lambda$$ with a $$+$$ sign as $$g^{00} = -1$$
$$\rho_{matter} \propto a^{-3}$$
$$\rho_{radiation} \propto a^{-4}$$
$$\rho_{\Lambda} \propto a^0$$
$$\partial_t (\rho a^3) + p \partial_t (a^3) = 0$$
The first term is the rate of change of the energy in a volume defined by the comoving coordinates. It is not zero unless the pressure is nil, but the pressure is not. In fact while $$p_{matter}$$ is negligible, $$p_{radiation} = (1/3) \rho_{radiation}$$ and $$p_{\Lambda} = - \rho_{\Lambda}$$.