Thank you for using Apple Support Communities! I understand you are encountering a "Disk not ejected properly" error when your MacBook Air goes to sleep. I would be happy to help point you in the right direction from here. Let's start by checking if this behavior changes when your Energy Saver preferences are adjusted.
Following the steps in the support article below, deselect the "Put hard disks to sleep when possible" checkbox:
macOS Sierra: Energy Saver System Preferences
If the issue still occurs, the next step is to isolate if the error is specific to a user account:
How to test an issue in another user account on your Mac - Apple Support
Specifically, use these steps:
Keep us posted with what happens from here.
If another user account is already set up on your Mac, you can simply log out of your account (Apple menu > Log Out) and log in with the other account. But the best way to test is with a newly created account:
- Choose Apple menu () > System Preferences, then click Users & Groups.
- Click , then enter an administrator name and password.
- Click the Add button (+) below the list of users.
- Complete the fields shown for a Standard or Administrator account, then click Create Account (or OK).
If you plan to test with any of the documents in your own account, make those documents available to the new account. Drag them to the Shared folder of the Users folder on your hard drive (~/Users/Shared). You can then move them to other folders after you log in as the new user.
Then log out of your account and log in with the new account:
- Choose Apple menu > Log out.
- At the login window, log in with the name and password of the new account. If you're also asked to sign in with an iCloud account or Apple ID, skip that step.
Now try to reproduce the issue in the new account. If you need to set up an email account or other account in order to test, you can do so.