If you look at the figure, you will see that θ1 should be smaller than θ2, but you have labelled θ1=40, and θ2=32.
Perhaps the two values have been inverted and perhaps that is the source of your problem.
Could you please check and let us know?