Peering cannot have UseRemoteGateway flag set true as remote virtual n/w referenced by the peering doesnt have gateways

Hi Team ,

I am getting below error while creating vnet peering in which both vnet has gatewaysubnet available.
error:
network.VirtualNetworkPeeringsClient#CreateOrUpdate: Failure sending request: StatusCode=400 – Original Error: Code=“RemoteVnetHasNoGateways” Message=“Peering /subscriptions/xxxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworks/xxx/virtualNetworkPeerings/xxx-xx-peering cannot have UseRemoteGateway flag set to true because remote virtual network /subscriptions/xxxx/resourceGroups/xx/providers/Microsoft.Network/virtualNetworks/xxx referenced by the peering does not have any gateways.” Details=

=====================
code:
provider “azurerm” {
subscription_id = var.azure_subscription_id
client_id = var.azure_client_id
client_secret = var.azure_client_secret
tenant_id = var.azure_tenant_id
features {}
}

resource “azurerm_virtual_network_peering” “vnet_peering_1” {
name = “{var.source_vnet_name}-{var.destination_vnet_name}-peering”
resource_group_name = var.resource_group_name
virtual_network_name = var.source_vnet_name
allow_virtual_network_access = var.allow_virtual_network_access_source_vnet
allow_forwarded_traffic = var.allow_forwarded_traffic_source_vnet
allow_gateway_transit = var.allow_gateway_transit_source_vnet
use_remote_gateways = var.use_remote_gateways_source_vnet
remote_virtual_network_id = var.destination_vnet_id
}

resource “azurerm_virtual_network_peering” “vnet_peering_2” {
name = “{var.destination_vnet_name}-{var.source_vnet_name}-peering”
resource_group_name = var.resource_group_name
virtual_network_name = var.destination_vnet_name
allow_virtual_network_access = var.allow_virtual_network_access_destination_vnet
allow_forwarded_traffic = var.allow_forwarded_traffic_destination_vnet
allow_gateway_transit = var.allow_gateway_transit_destination_vnet
use_remote_gateways = var.use_remote_gateways_destination_vnet
remote_virtual_network_id = var.source_vnet_id
}

=============
variables specific to gatewayssubnet:
variable “allow_gateway_transit_source_vnet” {
description = “(Optional) Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.”
type = bool
default = true
}

variable “allow_gateway_transit_destination_vnet” {
description = “(Optional) Controls gatewayLinks can be used in the remote virtual network’s link to the local virtual network.”
type = bool
default = true
}

variable “use_remote_gateways_source_vnet” {
description = “(Optional) Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.use_remote_gateways must be set to false if using Global Virtual Network Peerings.”
type = bool
default = true
}

variable “use_remote_gateways_destination_vnet” {
description = “(Optional) Controls if remote gateways can be used on the local virtual network. If the flag is set to true, and allow_gateway_transit on the remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Defaults to false.use_remote_gateways must be set to false if using Global Virtual Network Peerings.”
type = bool
default = true
}