Self driving cars maybe be better than the average driver but worse than the top drivers.
For security code it’s the same.
There is a reason why the average programmer should use established libraries for such cases.