Luffy hasn’t eaten the gomu gomu no mi he had eaten the eraser no mi. He can erase everything in his awakened form. Objects , people, memories, slavery or a 100 years. That power was used after Joyboy lost to erase the 100 years. That’s why Joyboy had the kozuki make something they could erase and that is the poneglyphs.