What is wrong with this limit reasoning $$\lim_{x \to 0}\left(\dfrac 1 {\sin x}-\dfrac1 x\right) $$
I solved this problem using the fact that near $x=0$ , $\sin x \cong x$),$(\sin x=x+O(x^2)$ therefore subtracting them results to $0$ which I did verify using other techniques, However, the same reasoning leads to $0$ in solving
$$\lim_{x \to 0}\left(\dfrac 1 {\log (x+1)}-\dfrac1 x\right) $$
while the correct result is $1/2$ although $\log(x+1) \cong x$ when $x$ is near zero$(\log (x+1)=x+O(x^2)$.What is getting wrong here?

We will be using the following three Taylor expansions: $\sin{x}=x-\frac{x^3}{6}+O(x^5)$, $\log(1+x)=x-\frac{x^2}{2}+O(x^3)$ and $\frac{1}{1-x}=1+x+O(x^2)$
$$\begin{align}\frac{1}{\sin{x}}&=\frac{1}{x-\frac{x^3}{6}+O(x^5)}\\&=\frac{1}{x(1-x^2/6+O(x^4))}\\&=\frac{1}{x}(1+\frac{x^2}{6}+O(x^4))\\&=\frac{1}{x}+\frac{x}{6}+O(x^3)\end{align}$$
And the limit in this case is zero. While
$$\begin{align}\frac{1}{\log(1+x)}&=\frac{1}{x-\frac{x^2}{2}+O(x^3)}\\&=\frac{1}{x(1-x/2+O(x^2))}\\&=\frac{1}{x}(1+\frac{x}{2}+O(x^2))\\&=\frac{1}{x}+\frac{1}{2}+O(x)\end{align}$$
And the limit is $\frac{1}{2}$
