Device Showing Incorrect Internal Storage Space

Answer: This can happen after a flash stock operation. The solution is to factory reset in stock recovery. If you want to preserve userdata you can try just wiping cache.  If you have already installed a custom recovery, you can use the toolkits Advanced Utilities > Fastboot Flash > Recovery > Restore Stock Recovery.

Follow Google’s instructions for factory resetting in stock recovery here: https://support.google.com/nexus/answer/4596836

If a standard factory reset doesn’t work, try flashing stock again.

If the issue still persists you can try ‘advanced utilities’ > ‘fastboot format’ > and then have it format system and userdata – then use “soft brick mode” to “Flash Stock + Unroot” one more time (if needed).