Trying to plot frequency response of a filter Transfer Function in MATLAB, it looks wrong
How did you derive the second figure? I got the different result using the following code:
b = 1 - r1;
a = [1, -2*r1*cos(theta), r1^(2)];
figure; freqz(b, a)

)
The only problme I can find in your code is that
TFdb= 20*log10(TF);
should be
TFdb= 20*log10(abs(TF));
Did you take the wrong sign of $a_1$ when calculating second transfer function?
b = 1 - r1;
a = [1, 2*r1*cos(theta), r1^(2)];

The above code generates the second figure.