[erc1155] What is best way to batchMint nft and send to someone also

Is this how I would mint an ERC1155 while transferring the token a specific address simultaneously (which is not msg.sender)? Below I modified mintBatch, and mint function.

Reason I am questioning - is because it appears to work in Remix test environment, but when I try running on testnet, Metamask is prompting the transaction is expected to fail (with no reason why).

Or perhaps is the ideal way in ERC1155 to 1) run mintBatch function, then 2) run safeBatchTransfer?


 function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts)
        _mintBatch(to, ids, amounts, '');

    function mint(address to, uint256 id, uint256 amount) public onlyOwner {
        _mint(to, id, amount, '');