As said charging the iPhone with the Macbook should have no adverse consequences.
Apple even suggests this as a valid charging option, and makes no mention of whether the Macbook is plugged in or not.
The most that may happen is the Mac may take a little longer to charge.
There is no conceivable issue with iths from the electric or electronic standpoint.
If your iPhone, iPad, or iPod touch won't charge - Apple Support
Plug your charging cable into a USB wall adapter, then plug the adapter into the wall.
Plug your charging cable into a USB 2.0 or 3.0 port on a computer that's on and not in sleep mode. Don’t use the USB ports on your keyboard.
Plug your cable into a powered USB hub, docking station, or other Apple-certified accessory.