I know this sentence is correct.
He was too busy working at a factory.
but I wonder whether this sentence is correct and natural. (specially in grammar)
He was too busy to work at a factory.
Both sentences are grammatical, but mean different things.
He was too busy working at a factory.
means that because he was working at a factory so much, he could not do anything else.
He was too busy to work at a factory.
means that because he was doing something else so much, he could not work at a factory.
Busy + v. + ing
He was too busy working at a factory.
= He was occupied with working at a factory. (he was actually working at a factory)
Too + adj. + to + v.(inf.)
He was too busy to work at a factory.
= He was occupied with doing something else (not working at a factory) that prevented him from working at a factory.
Perhaps if I point out that 'The colourless green squares rolled speedily up the perpendicular mountain' is wholly correct, it will show how careful you have to be about thinking that a grammatically correct sentence will produce a meaningful statement.