You can either put the commands inside Draw2D() and put this in the placeholder of an image region (Insert> image) or you put the commands directly in the placeholder of a Maxima-Draw2D region. You mixed the approaches.
See the introductory text in the Chapter Plotting with Maxima.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9