ok. the optimize industry doesn't work like you described. this option does not put additional workers in the industry if it can't produce it in one turn.
my duranium mine planet 17/25 industry and 20/37 Duranium. put an building in the queue which need 2 turn with 17 industry workers. activate optimize industry. reduce the industry to 9/25 and increse the duranium to 24/37 and 4 to food. yes used store food was enabled. if it would try to maximize it, it could have put an additional worker in it, because with 18 workers the same building needs just 1 turn.