Compare the first and second trays
If the first tray baked well and the next one flattened, check the tray itself. A sheet still warm from the oven starts melting the dough early. Let the tray cool or use a second sheet, and keep the next portions chilled if the recipe calls for it.
Follow the dough’s rest
Chocolate Chip Cookies calls for chilled dough. Give it that time before changing the ingredient amounts. If every tray spreads, recheck the flour measurement and whether you used the tray liner the recipe calls for. Change one thing at a time so you can tell what helped.
Further reading in King Arthur Baking’s cookie guide.