Narration

Direct: You said “I make chairs work magic”.
Indirect: You said that you made chairs work by magic.
why by here what is the role of its here?

Direct: “I make chairs work magic”.
Indirect: You said that you made chairs work magic.

Direct: “I make chairs work by magic”.
Indirect: You said that you made chairs work by magic.

“work magic” = perform magic; figuratively, achieve the seemingly impossible
“work by magic” = operate apparently in violation of normal physical laws

Both are odd things to say about chairs.