why are the degrees of freedom for a chi-square test on a 2x2 contigency table always 1?

I know the "formula" is (# rows - 1) * (# columns -1). However, shouldn't the design of the experiment or observational study being conducted make a difference?

The only experimental design I can think of where 1 d.f. makes sense to me is for a 2x2 table when both margins are fixed - such as in Fisher's famous "lady tasting tea" experiment. Since both margins are fixed, we only need to know 1 of the 4 values within the 2x2 table to fill in the rest of the table, so only 1 value within the table is "free to vary" and therefore 1 d.f.

But what if instead we have an observational study, where only the total number in the sample is known? Now we need to know 3 of the 4 values in the 2x2 table before we can fill in the last value. So in this case, 3 values are "free to vary" and therefore 3 d.f.?

And finally, if we have 2 separate samples where the number in each sample is fixed by design, we need to know 2 values in the table before we can fill in the remaining 2 values; 2 are "free to vary" so 2 d.f.?

Apologies if above betrays a naive/incorrect understanding of how degrees of freedom actually work. As I have attempted to research the topic, this idea of values that are "free to vary" made some intuitive sense to me, so I became curious as to why it wouldn't work as described above for chi-square tests.

Originally, Karl Pearson provided Chi Square statistic to compare observed versus expected values in a contingency table, where you have a sample of size $n$ (this is always fixed) in $k$ different classes. He was based in the multinomial distribution, where sample size is fixed, and arrived at the expression used today of the sum of the squared difference between observed values and the expected, divided by the expected. At this point, we have $k$ classes and only $k-1$ of them "vary freely".
In a 2 by 2 table, we have 2 variables (or two samples) with 2 levels and in each one we have $(k-1)=1$ that vary freely. The total number of cells that vary freely then is $(k-1)(k-1)=1$ again.