It is a bit hard to know in advance which method is optimal.
In your scenario, gasEstimate states that the second method is less expensive.
To test your implementation I stripped everything from the contract except for the assign of the value (also I have a fake structure):
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;...