When Barney and CJ enter room 420, there's a large, curtained window on their immediate right. This isn't possible, since room 418's door is just to the right of room 420's door.
Near the end, Andy and Barney walk toward the elevator while talking. The elevator door just happens to open without them even pressing the button and they don't even pause for a moment waiting for the doors to open. It's as if they knew the elevator would open at the exact step for them to enter.
Andy and Barney leave town without leaving anyone in charge during their absence (not even a comment about Mayberry being safer with no one in charge than with Barney in charge) and the business with the commissioner does not require both of them.
Andy goes off to police headquarters for an in-depth tour of Raleigh's modern methods, leaving Barney behind, to do nothing, at the hotel.This is completely counterintuitive to what's known about Barney, as he's always the one talking about modern methods/technology in police work and how badly Mayberry lags behind ("Why, we don't even have a helicopter!"). Barney would be the one most interested in Raleigh's modern methods, not Andy, and it makes no sense that he did not go to police HQ for a tour.
Barney and Mr. Hasler lock the house detective inside a bedroom closet by simply turning a latch on the outside of the closet door. Closets don't normally have a lock, because the only purpose would be to keep someone inside.
Taylor and Fife are outside of their jurisdiction and shouldn't be investigating a crime nor making arrests. Raleigh law enforcement is not mentioned.