I tried to reproduce same in my environment I got the results successfully like below.
To assign owner access to all the resource groups you can make use of below PowerShell comment like below:
Connect-AzAccount
$resourceGroups = Get-AzResourceGroup
$resourceGroups | ForEach-Object {
New-AzRoleAssignment -ObjectId <USER OBJECTID> -RoleDefinitionName "Owner" -Scope $_.ResourceId
}

To get object ID of credentials or user Go to azure active directory -> user -> select user -> object ID like below:

According to your scenario as you have 300+ resource groups and you want to assign owner access to 250 resource groups try the below.
Go to resource group and export csv file and remove resource group which you don't want to assign access keep only resource group which you want to assign owner role in csv file like below:


When I use the PowerShell command I am able to assign owner access to list of multiple resource groups like below:
# Import CSV file with resource group names
$resourceGroups = Import-Csv -Path <PATH OF YOUR CSV FILE>
foreach ($resourceGroup in $resourceGroups) {
# Assign the role to the user or group
New-AzRoleAssignment -ObjectId ad4818XXXXXXXX -RoleDefinitionName "Owner" -ResourceGroupName $resourceGroup.ResourceGroupName
}
Output:
