How to transform a field to lowercase

I am transforming a field from .tf to lowercase in my provider and getting this error:

│ Error: Provider produced inconsistent result after apply
│ When applying changes to, provider
│ "provider[\"\"]" produced an unexpected new value:
│ .name: was cty.StringVal("newDatabase2007"), but now
│ cty.StringVal("newdatabase2007").
│ This is a bug in the provider, which should be reported in the provider's own
│ issue tracker.

Look into “plan modification” if you’re going to change a configured value to something other than what’s in the configuration.

You can implement plan modification across the whole resource, or on an attribute-by-attribute basis (probably what you want in this case).

Alternatively, if only lowercase values are valid, you might solve the problem with a validator which ensures that only lowercase values are permitted.