NEW YORK ( TheStreet) -- UBS ( UBS - Get Report) last month was close to hiring Robert McCann to head the bank's wealth management business in the Americas. But his old employer, Bank of America ( BAC - Get Report), won't allow him to go just yet.

McCann plans to say Wednesday in New York court that he was fired from BofA after it bought Merrill Lynch in January, leaving him free to begin working at a rival firm six months later. But Bank of America is trying to make him wait until the end of January, when it says McCann's noncompete agreement ends, and if he doesn't it will cause the bank "serious and incalculable harm," according to court documents, the Wall Street Journal reports.

Bank of America hired Sallie Krawcheck, a former chief financial officer of Citigroup ( C), in August to run the bank's big brokerage division, the unit that McCann once led. BofA is afraid that once McCann joins UBS he'll try to hire some of Merrill's top producers and lure away big clients, the Journal notes.

In court papers filed Tuesday, McCann said BofA fired him without cause after rejecting his offer to resign, part of "vengeful conduct intended to both punish and humiliate" him for trying to quit the bank, according to a report from Bloomberg. He seeks an immediate lifting on the noncompete clause at the hearing Wednesday.

BofA's handling of McCann's departure also may affect the payout of more than $18 million in stock, the Journal notes, but McCann on Wednesday only will ask the judge to rule on whether he can take another job immediately.

-- Reported by Joseph Woelfel in New York .

Follow TheStreet.com on Twitter and become a fan on Facebook.