It never hurts to try an SMC reset and a PRAM reset (hold the PRAM reset for at least three chimes or a full minute if the laptop doesn't chime).
There is a possibility that you will need to have Apple remap the Keyboard and Trackpad for you. The MBAirs must have this remapping performed whenever the Keyboard or Trackpad are replaced. It basically sets the keyboard type of the laptop. One of our organization's MBAirs had a keyboard issue that was fixed by this remapping. An Apple Store or an Apple Authorized Service Provider can do this for you. Maybe this was never done originally or perhaps this mapping has gotten corrupted.
The only other thing I can think of is to delete any keyboard preferences and localization preferences in case the preference file is corrupted. There is a keyboard preference file in the hidden User Library Preferences ("~/Library/Preferences") which can be accessed by Option-clicking on the Finder's "Go" menu and selecting "Library", then navigate to the "Preferences" folder and look for a "com.apple" .plist file for the keyboard.
I'm not sure where the localization preference file is located, but it would be in the system area of macOS. Maybe another contributor will be able to assist here.
Maybe you could try it with a new user account:
https://support.apple.com/guide/mac-help/set-up-other-users-on-your-mac-mtusr001/mac
You can also make sure to have a good system backup then perform a clean install of macOS by first erasing the whole physical drive before reinstalling macOS. Make sure to test the laptop before installing, migrating, or restoring anything from a backup. If you have a problem with the clean install, then you have some sort of hardware issue.
How to Erase physical drive:
https://support.apple.com/en-us/HT208496
Recovery Mode Options:
https://support.apple.com/kb/HT204904