You can try using the bounded
method instead of golden
.
method="golden"
(i think method="brent"
too) take a bracket as a starting guess and may sample outside it.
method="bounded"
enforces bounds strictly causing all evaluations and the solution to stay in [a, b]