How to set equivalent PDFs for cosine-weighted and uniform-sampled hemispheres?
So, for Uniform sampling the PDF is $1/2π$, For Cos-weighted its $cos(θ)/π$. The Lambertian BRDF has a $\pi$ term as well in the denominator for energy conservation.

When not optimizing things you should be dividing by $\pi$ during the BRDF calculation, then dividing by the proper PDFs mentioned above.

Considering all the factors into account, for uniform sampling you'd have

$L_i*brdf*\cos(\theta) * \displaystyle{\frac{1}{pdf}}$

$L_i * \frac{color}{\pi} * \cos(\theta) \displaystyle{\frac{1}{\frac{1}{2\pi}}}$

$L_i * {color} * \cos(\theta) * 2$

Similarly for Cosine-weighted hemispherical sampling you'd have

$L_i*brdf*\cos(\theta) * \displaystyle{\frac{1}{pdf}}$

$L_i * \frac{color}{\pi} * \cos(\theta) \displaystyle{\frac{1}{\frac{\cos(\theta)}{pi}}}$

$L_i * {color} $

Since you weren't dividing by $\pi$ in the BRDF, the division by the PDF should have been $1/2$ and $\cos(\theta)$ as you suggested but couldn't understand since the actual pdfs have a factor of $\pi$ in them.