Someone gives you their bank information and asks you to log on to their account in order to transfer money to your account. When you attempt this, it asks for a COT code which you do not have. Can they obtain your bank information if the attempt was unsuccessful?
A bit of googling suggests that this is indeed a scam.
There is no such thing as a "COT code", but the term is sometimes used as one of the steps in an advance fee scam. The victim is told that before they can receive a wire transfer of the large amount they've been promised they need to pay to have a "COT code" (which ostensibly stands for Cost Of Transfer) issued. They're directed to an office that will issue such a code, but in reality they will be paying an accomplice of the scammer.
If you have been given credentials to log into someone's bank account, especially a foreign bank or a bank whose web address you didn't already know in advance, chances are that you're looking at a fake bank website that exists only to (a) make it look like there is a huge amount of money waiting to be transferred to you, and (b) to ask you for the non-existent "COT code" so you will be guided to the next step in the scam.
If you have entered your own account details into the fake website, the scammer will now know everything you typed into it. If you're in a country with sufficiently dysfunctional banking practices (such as the United States), merely knowing your account number might be enough for the scammer to construct fake checks that draw on your account. Contact your bank ASAP to get advice on how to mitigate this.