Consider a three-fold intersection $U_{i} \cap U_{j} \cap U_{k}$ of a trivialising Leray cover $\{\mathcal{U}\}$ for a real line bundle L over a $C^k$ manifold $M$. We have $g_{ij}g_{jk}g_{ki} = 1$ and thus \begin{align} \ln|g_{ij}| + \ln|g_{jk}| + \ln|g_{ki}| = 0 \end{align} Thus $\{\ln|g_{ij}|\} \in Z^{1}(\mathcal{U}, C^k)$. That is, this array defines a $1$-cocycle with coefficients in the sheaf of $C^{k}$ functions on the overlaps. Now it is a theorem that if the sheaf that the cochains take values in, admits partitions of unity, then the cohomology vanishes. That is, every cocycle is a coboundary so we can write \begin{align} \ln |g_{ij}| = f_{i} - f_{j} = \text{ln}(e^{f_{j}}e^{-f_{i}}) \end{align} for a $1$-coycle $\{f_{i}\}$ on the open cover. Hence \begin{align} \ln|e^{-f_{j}}g_{ij}e^{f_{i}}| = 0 \end{align} Now if $\{s_{i}\}$ is a section which gives a trivialisation over $U_{i}$ define $s'_{i} = e^{f_{i}}s_{i}$. Doing this in every coordinate patch we get that the transition functions with respect to this new trivialisation can be found like \begin{align} e^{f_{i}}s_{i} = e^{f_{i}}g_{ij}e^{-f_{j}}e^{-f_{j}s_{j}} \implies s'_{i}= e^{f_{i}}g_{ij}e^{-f_{j}}s'_{j} \end{align} but $|e^{-f_{j}}g_{ij}e^{f_{i}}| = 1$. So the transition functions of any line bundle can be taken to be in $\{-1,1\}$.
Since the transition functions of this bundle can be taken to be constants it is a theorem that the bundle admits a flat connection.
I don't have any intuition for why this result would be true. Is this result true, and if not, where is the mistake in my working?
This result is true and your approach is correct. Not an intuition, but the obstruction of the existence of a flat connection is the curvature which vanishes here because the dimension is $1$.
https://en.wikipedia.org/wiki/Connection_(vector_bundle)#Curvature