The optimization region is the part INSIDE the dashed line; the part outside that line cannot be moved, it has to remain exactly the same as the electrode. If you compare your device with the tutorial you see that the example has many more layers inside the scattering region - those are the ones which are optimized.