I think if we go by Jeremy Crawfords explanation that the beast has a turn in the initiative order directly after the ranger it would then be using its reaction if you sacrifice an attack to command it to attack during the rangers turn, same as the fighters maneuver that allows them to sacrifice...