getPixels() not working?

I am trying to copy a part of an image to another one but the code is not working. I followed the instructions here.

The following code is throwing an error. According to the documentation and also the source code this should work.

I call this:
bool ofPixels_::pasteInto(ofPixels_ &dst, size_t x, size_t y)

Using this:
ofPixels_ & ofImage_::getPixels()

Any ideas?

ofFloatImage ofApp::processImg(ofFloatImage img) {

  ofFloatImage processImg;
  int processImgW = 100;
  int processImgH = 100
  processImg.allocate( processImgW, processImgH, OF_IMAGE_COLOR);
  ofPixels tempPixels = img.getPixels();
  tempPixels.pasteInto(processImg.getPixels(), 0,0 );

  return processImg;

}
/mnt/FILES/CODE/OF/OF_100_64B_GCC6/apps/myApps/myApp/src/myApp.cpp: In member function ‘ofFloatImage ofApp::processImg(ofFloatImage)’:
/mnt/FILES/CODE/OF/OF_100_64B_GCC6/apps/myApps/myApp/src/myApp.cpp:276:44: error: cannot bind non-const lvalue reference of type ‘ofPixels_<unsigned char>&’ to an rvalue of type ‘ofPixels_<unsigned char>’
  276 |   tempPixels.pasteInto(processImg.getPixels(), 0,0 );

Please read this thread. Same topic

no unfortunately the problem persist with the proposed solution (which is not the way it should be done btw)

  ofPixels & tempPixels = img.getPixels();
/mnt/FILES/CODE/OF/OF_100_64B_GCC6/apps/myApps/myApp/src/myApp.cpp: In member function ‘ofFloatImage ofApp::processImg(ofFloatImage)’:
/mnt/FILES/CODE/OF/OF_100_64B_GCC6/apps/myApps/myApp/src/myApp.cpp:275:57: error: cannot bind non-const lvalue reference of type ‘ofPixels&’ {aka ‘ofPixels_<unsigned char>&’} to an rvalue of type ‘ofPixels’ {aka ‘ofPixels_<unsigned char>’}
  275 |   ofPixels & processImgtempPixels = processImg.getPixels();

The following code works but it forces to create ofPixels instances and then recreate the original image.

  ofPixels tempPixels = img.getPixels();
  ofPixels processImgtempPixels = processImg.getPixels();
  tempPixels.pasteInto( processImgtempPixels , offsetX,offsetY );
  processImg.setFromPixels( processImgtempPixels );
  processImg.update();

The following code (theoretically the same as above) throws a core dumped error (!):

  img.getPixels().pasteInto( processImg.getPixels() , offsetX,offsetY );
  processImg.update();