Thank you for your opinion, Don Pappo. As you say, it certainly sounds like Sollozzo made a mistake by not considering that Michael had killing experience from the war (albeit from a distance, as Sonny noted

).
I just thought of an answer to my first question. If Sollozzo ordered the restaurant owner to only admit his
regular customers, then I suppose one of Sonny's men could have offered a
bigger bribe (or a bigger threat

) so that he would be allowed to pose as a regular customer, thus allowing him to plant the gun in the washroom. (I can envision him convincing the restaurant owner, telling him that "Sollozzo and his policeman friend will be dead before the evening's over. You won't have to worry about retaliation from him.")
This corresponds with your opinion that Sollozzo made a mistake. It would have been smarter for him to order that the restaurant be emptied and that only his own people be there to pose as diners. But I guess he didn't think of everything

. As Turnbull says, it's another classic case of
Godfather characters underestimating each other.
I suppose an element of luck and timing was involved too. Sollozzo's men must have searched the restaurant earlier, and Sonny's man must have planted the gun AFTER the search was over. Luckily for Michael, the two sides didn't cross paths in the bathroom!