re: "I've sent some private document like my passport and my bank statement on a upwork chat....did i make an error?"
Upwork itself asks for identity verification information, such as passports, drivers licenses, etc. This may include a bank statement.
Traditionally we do not refer to this as "Upwork chat."
There are specific tools and processes that Upwork provides for going through its identity verification processes.
If this is what you did, then DON'T WORRY.
I have personally undergone Upwork identity verification processes, including providing scans of my driver's license. I AM NOT WORRIED about any of that.
If you were talking to a client or potential client, through the Upwork Messages tool...
Then you probably DID make a mistake. And the next thing you should do is tell us more about your experience so we can provide you with additional information and advice.