Irritation of the pleura: The pleura is the lining of the chest cavity. During a thoracentesis, a needle is inserted into the chest cavity to remove fluid. This can irritate the pleura, leading to coughing.
Air leak: A thoracentesis can sometimes cause a small air leak into the pleural space. This can cause coughing and shortness of breath.
Re-expansion of the lung: After a thoracentesis, the lung re-expands to fill the space that was previously occupied by fluid. This can cause coughing as the lung stretches.
Infection: A thoracentesis can sometimes introduce infection into the pleural space. This can cause coughing, fever, and other symptoms of infection.
I hope this Answer may have helped.