Shooting for "Ray Donovan" was interrupted after cops say a homeless man refused to leave the set ... which resulted in a 5 officer takedown.
Law enforcement tells TMZ off-duty uniformed officers were working security on the Venice beach set last Friday when it went down. We're told cops told him several times to back away from Liev Schreiber -- but instead he took a swing at an officer and tried to run.
It took several cops and a taser to restrain the guy. He was booked for battery on an officer.
We're told no one on set was involved, but y'know Ray Donovan could've handled it.