Ryan Coogler was clearly stunned when cops pulled guns on him as he tried to make a legal withdrawal from his bank account — and his confusion/outrage fully plays out on police body camera footage.

As you can see in the video, obtained by TMZ, the famed director of “Black Panther” and “Creed” is unsure why he was suddenly surrounded by police inside an Atlanta Bank of America — and then quickly handcuffed and brought out to a squad car.

Even before Ryan has a clue as to why they’ve detained him … he tries telling the officers, during this January incident, they’ve got an innocent guy. He calmly pointed them to his work badge — he’s shooting the ‘Panther’ sequel in ATL — and suggested they Google his

In the video, Ryan does his best to keep his cool as he’s being questioned about what he was doing inside the bank.

TMZ broke the story … Ryan tried to take out $12,000 from his account, handing the teller a withdrawal slip with a note scribbled on the back, requesting the teller count the cash in the back.

Black Panther Director Ryan Coogler Mistaken as Bank Robber

As Ryan tells cops in the video, he didn’t feel safe saying the large amount out loud, or having the money counted out at the teller’s station. He says it’s the first time there’s been an issue with one of these transactions, and he also explains why he regularly makes them.

As we reported … cops investigated and said it was all a huge mistake … with police saying they just responded to a 911 call from a BoA employee who told her boss Ryan was attempting to rob the bank.

In the body cam footage, Ryan tries to find out who made the call from inside the bank … and he also asks cops for badge numbers of all the responding officers once he’s released.

As he told TMZ … “This situation should never have happened. However, Bank of America worked with me and addressed it to my satisfaction and we have moved on.”