Microorganism produce their own antibiotic, could they change the type of antibiotic to face some challenges such as stress or the growth of other microorganism in their growing media or to overcome the resistance of other competitive microorganism?
It is a vague question, If you refer to bacteria as "microorganisms", and from prospective of how bacteria behave when the cells expose to antibiotics during the growth cycle within a good well maintained environment, from my knowledge there is no well known mechanisms that scientist find about the interference of bacteria to change the structure of that outsider antibiotics compound. Bacterial cells have many mechanisms during the stress or to overcome the effect of that antimicrobial agents. For example, stress stimulates some sensing chemicals to enhance the growth of other adjacent cells then produce more resistance cells and polymers to form a film then a community of more resistance cells called then biofilm.
If you mean that bacteria or fungi "microorganism" form their own formed antibiotics then this well be another story.