A few things worth mentioning:
1- The "max_instances" element under "automatic_scaling" is a parameter that cannot be set in app.yaml if using 'appcfg'. This is why you were getting the deployment error, and is documented here [1]. You should instead set this specific parameter in the API explorer [2] or the Admin API [3].
2- Setting "max_idle_instances: 0" is invalid, as the accepted range for the value is between 1 and 1,000 which is explained here [4]. Part of the auto_scaling process requires to have instances in an idling state at some point, so setting it to 0 doesn't make sense. You may set this value to a lower value than what would be enforced by the default value "automatic", which will lower costs but can degrade performance in the face of volatile load levels. The goal is to strike a balance between costs and acceptable performance per your own standards.
3- The "min_idle_instances" [5] is a value you may be interested in reading more about as well, as this is one way to reduce costs but also necessitate tuning to make sure the desired performance is also met, as is the case with the "max_idle_instances" setting. For example, if there are long stretches of time where there are no requests, the number of idle instances could go to zero which would incur no costs. Doing so will generate a cold start from the next loading request [6], which will have a higher latency. If you prefer to always have an idle instance ready to serve request, this reduces latency by eliminating the loading requests but incur higher costs. You could also look into warmup requests [7].
4- Idle instances are not free as mentioned here [4], and explained more specifically here [8].