I tried this in a test program and it worked:
size(400, 600,P3D);
surface.setResizable(true);
Check this https://github.com/processing/processing/issues/3952
The only trick for me on a Win OS is that the mouse pointer does not change when it hovers on the edge of the window. However, if I click right at the edge and I drag the mouse, the window’s size adjusts to a new size.
Kf