Pat the cod fillets very dry with paper towels and cut into even 1-inch cubes.
In a large bowl, toss the fish with Shaoxing wine, salt, black pepper, and beaten egg until evenly coated. Add the cornstarch right before frying and toss until each piece is fully coated. If any spots remain uncoated, add 1-2 tablespoons more cornstarch as needed.
Heat the vegetable oil in a large pan over medium heat to 325-350°F. Alternatively, insert a wooden chopstick into the oil; rapid bubbles should form around it.
Add the fish in a single layer without overcrowding, working in batches if needed. Fry for 5-7 minutes total, leaving the fish untouched until golden and crispy on the bottom. Flip and continue frying until golden and crispy and the fish reaches an internal temperature of 145°F. Transfer to a wire rack to drain, letting the oil return to 325-350°F between batches if needed.
Remove the excess frying oil, leaving 1 teaspoon in the pan. Add the ginger, garlic, green onions, red chili, and sugar and stir-fry for about 10 seconds until fragrant.
Return the crispy fish to the pan, add the Shaoxing wine, and gently toss until evenly combined. Remove from the heat immediately to keep the coating crisp. Season with more salt and black pepper to taste, if needed.