One place I worked started stock-taking (or inventory, as you call it) whilst it was still open, but this was done in a way that worked. They would start with the storerooms in the back, before moving onto the aisles where the stuff that didn't sell too well. But even then, they would seal those aisles off so customers or staff simply could not fuck things up: intentionally or unintentionally.
The only staff members who were allowed in an aisle once it was sealed off were the people counting the stuff there. If a customer tried to duck under the tape to get something from there, they were basically politely told that they could get whatever it was tomorrow, but not today, sorry.
After the shop was closed was when the rest of the shop floor got done. Anything like stuff to go back out or returns received that day were stacked to one side and counted at the very end, and actually dealt with the following day.
This gave us the best of both worlds - the count could be started early, whilst the shop was still open, so there wasn't staff there until ludicrous o'clock, whilst also minimising or eliminating fuck ups caused by people shifting stuff around during the count.