There is actually a second Display brightness/dimming option related to the battery....this setting is a bit hidden & varies between different versions of macOS. Search within the System Settings/Preferences for "Slightly dim the display on battery" and make sure it is turned off or unchecked. On macOS Ventura, this setting is located in the Display System Setting.....clicking the "Advanced" button will give you this setting option. When this is enabled the display will dim whenever you wake the laptop or after logging back in after the screen is unlocked.
Even with this other setting turned off, I've been seeing this occur with my organization's MBAir (M1, 2020) models running macOS 14.x Sonoma even after adjusting the screen brightness to full. I have found a way that seems to prevent the display automatically dimming again at least while on battery. Here is what you need to do:
Place your hand over the camera, that will cause the display to dim....let it dim.
When it stops dimming, keep your hand blocking the camera and adjust the screen brightness to full.