In your figure 1 let's defineI have rewritten my answer to address the concerns made in comments by @juancarlosvegaoliver.
Instead of it being a unit vectorrotation let it be simple harmonic motion in one dimension along the $\hat k$$x$-axis (vales increasing from left to represent an anticlockwise rotationright) and then I will show its relevance to the question asked.
The displacement from $O$ is $\theta \hat k$,$\vec x = x \hat x$ where $x$ is the angularcomponent of the displacement in the direction of $\hat x$.
The velocity is $\dot \theta \hat k$$\dot x \hat x$ and the angular acceleration is $\ddot \theta \hat k$$\ddot x \hat x$.
The torque
The force is $mgd \sin \theta \, (-\hat k) = - mgd \sin \theta \, \hat k $$-k\vec x = -kx \hat x$ and from that you get your equation $$I\ddot \theta \hat k =- mgd \sin \theta \, \hat k \Rightarrow \ddot \theta =- \dfrac{mgd \sin \theta}{I}$$
In your figure$-kx$ is the 2component let's define a unit vectorof the force in the direction of $\hat K$ to represent a clockwise rotation$\hat x$.
SoAt a position like $A$ the angle as drawndisplacement $\vec x$ in the direction of $\hat x$ and the direction of the (restoring) force is in the direction of $\theta (-\hat K)=-\theta \hat K$,$-\hat x$.
At position $B$ the angular velocitydisplacement is in the direction of $\dot \theta (-\hat K)=-\dot\theta \hat K$$-\hat x$ and the angular accelerationdirection of the (restoring) force is in the direction of $\ddot \theta (-\hat K)= - \ddot \theta \hat K$$+\hat x$.
The torque isSo using $mgd \sin \theta \, \hat K$ and from that you get your equation$\vec F = m\vec a \Rightarrow -kx\hat x = m\ddot x \hat x \Rightarrow \ddot x = -\frac km x$ for all values of $$-I\ddot \theta \hat K =mgd \sin \theta \, \hat K \Rightarrow \ddot \theta =- \dfrac{mgd \sin \theta}{I}$$$x$ whether positive or negative.
If your diagrams were showingSwitching the positions at maximum excursion at time equaldirection of the unit vector to zero$\hat X = - \hat x$ makes no difference because now $\vec x = -x \hat X = -x \,(-\hat x) = x \hat x$ and $\vec a = -\ddot x \hat X = -\ddot x \,(-\hat x) = \ddot x \hat x$.
$\vec F = +kx\hat X = +kx (-\hat x) = -kx \hat x$.
For example, $2 \hat X = -2 \hat x$ and both give the amplitude ofposition as $x=-2$
Having the motion was $\Theta$ then$x$ axis pointing from right to left only results in a change of sign so, for figureexample a position of $x=-2$ would now be $x=+2$.
Diagram 1 is the initial angular displacementsame as my diagram except that now $\vec x = x\hat x$ etc is replaced by $\Theta \hat k$$\theta \hat k$ etc and that for figure 2$\vec F - -k x \hat x$ is replaced by $\Theta (-\hat K)= -\Theta \hat K$ which$\vec \tau = - mgd \sin \theta \,\hat k$.
The direction of $x$ increasing is consistent withto the fact thatright is replaced by the direction of $\hat k = -\hat K$$\theta$ increasing is anticlockwise.
You would made life easier by usng the mirror image of figure 1 when drawing figureDiagram 2 which is just a reversal of the same as looking atunit vector such that the figurenew unit vector 1 pendulum from$\hat K = - \hat k$ with the other side ie looking at figuredirection of increasing 1 from "inside"$\theta$ still anticlockwise.
I have shown for the computer screenone dimension motion reversing the direction of the unit vector does not change anything and it is the same for the example with rotation.
$\vec \theta = -\theta \hat K = -\theta \,(-\hat k) = \theta \hat k$ and $\vec \alpha = -\ddot \theta \hat K = -\ddot \theta \,(-\hat k) = \ddot \theta \hat k$.
$\vec \tau = +mgd\hat K = +mgd (-\hat k) = -mgd \hat k$.