Why dc motor is buzzing when using it with XL6009 converter?
"sometimes the motor is rotating and sometimes is buzzing" is a clue that the boost IC does not have enough current to start a stopped motor. It is random because the position of the motor contacts is not random. At a stop state the motor contacts are engaged so the motor will start. Either the start current is borderline with what the booster IC can work with, or you need larger value electrolytic caps on the power to the motor. Also check the current limiting on the booster IC. Maybe it is adjustable and can put out more current safely to start the motor every time. The 'buzzing' sound is the boost IC trying to start the motor with pulses of current that are not quite strong enough, so the motor does not turn, but sits there in an over current state-buzzing. The motor needs more starting current.