Why Does This Optimization Algorithm In R Stop After A Few Function

Why Does This Optimization Algorithm In R Stop After A Few Function