How to use for_each with databricks_grants resource

Your code has lost all its indentation, and is hard to read - Welcome to the forum - please reformat your message

You are using the databricks_grants resource improperly - as hinted at by it having a plural name, each single instance of databricks_grants manages all the grants for a catalog, etc.

You’ve got each of your two instances of databricks_grants set up to fight with each other, and the last processed wins.

You need to have only one databricks_grants resource, and inside that resource, use Dynamic Blocks - Configuration Language | Terraform | HashiCorp Developer to specify the variable number of nested grant blocks inside that single resource.