The Ancestry Wiki offers an Overview of the US Census. They cite William Thorndale and William Dollarhide, Map Guide to the U.S. Federal Censuses, 1790–1920 (Baltimore: Genealogical Publishing Co., 1987) for this section:
According to the 1850 census instructions, the enumerator, on
completing the entry for each family, farm, or shop, was to read the
information back to the person interrogated so that errors could be
corrected immediately. But if an informant was unclear or incorrect in
giving information in the first place, this procedure did little to
correct errors. A significant portion of the American population could
not read or write in the nineteenth century, so if an enumerator
misspelled the family surname it could easily have stayed that way,
whether or not the enumerator repeated it.
As the enumeration of each sub district was completed, the enumerator
was to make two copies, which were to be carefully compared to the
original for accuracy. Hand copying, of course, frequently produces
mistakes. Experience with the various copies of the census shows that
most copies were not error free. It was cumbersome and tedious to copy
names and endless columns of personal information. Most enumerators
probably never thought their copies would be read again once the
statistical tabulations were completed, so it is easy to believe that
many became careless as the job wore on.
As the process was completed, the enumerator was to sign each page of
the census, and at the end of each set of copies, to certify that the
census had been taken and copied according to instructions. One set
was to be filed with the clerk of the county court, and the other two
were to be forwarded to the supervisor. As the supervisor received the
completed schedules, it was his or her duty to see that every part of
the district had been visited and that the copies were in good order.
One set was then sent to the state or territory, and the other was
forwarded to the U.S. Census Office for statistical analysis.
Unfortunately, it is almost impossible to distinguish the original
census taken by the enumerator—the one likely to be most accurate—from
the copies. While it is usually not possible to know if the original
census or a copy was sent, it is relatively easy to recognize the
census that was sent to the Census Office. “Researchers can
distinguish the latter set from the other two because the Census
Office made tabulations directly on the schedules; consequently, the
central office copy bears pencil, crayon, and red ink markings on
virtually every page.”
In the next paragraph, they say that the process of making three copies was abandoned in 1880.
IPUMS USA (Integrated Public Use Microdata Series) at the University of Minnesota has the Enumerator Instructions:
Obviously in any situation where a person records information that is reported to them by someone else, especially when hand copying also takes place, mistakes can creep in. The only census I know of where we know we are looking at self-reported information, and at the original enumeration, is the 1911 Census of England and Wales, where researchers can see images of the forms filled out by the heads of households themselves. For all others, I think it's safe to assume that you are looking at a copy, unless you have a compelling reason to think otherwise. In this particular case, where we have census years in which three copies were made, one can check with local and state archives to see if other copies have survived besides the one sent to the Census Office.
Another thing we don't know is how soon the copies were made after the original schedules were filled out. Note that the instructions say that the enumerator was supposed to fill in the date each page was started -- some enumerators made marginal notes for each day if the page spanned more than one day, but that was not part of their original instructions, so you can't count on that. But we have no evidence for how much time passed before the pages were copied, nor do we know how the pages were copied. The preferred method of copying, especially in the era where ink pens had to be blotted, would be to copy each row, in the same manner that the original pages were filled out. But just as some indexers do today, some people might have chosen to copy a column at a time, which can introduce errors.
I wonder too if, contrary to the instructions, some enumerators might have asked someone else to copy the schedules for them (checking the signature of the enumerator against all the pages bearing his name might be one way to look for that), or if some pages might have been re-copied at the central office if the enumerator's page was damaged or hard to read. In that case, a copyist might see a name like "Willie" which is customarily given to a man, and write "male", second-guessing the original sheets.
In all these cases, rather than automatically assuming that the enumerator made a mistake during the initial enumeration, I prefer to treat these unexpected pieces of information as clues about how the record was made.
While I have seen unexpected information on the census schedules themselves, the majority of cases of unexpected gender I've seen have been in the indexing for the record, and not the record itself. I have seen many cases on Ancestry.com where the index says one thing and the record says something else entirely -- yes, even 'daughter' when the record says 'son' and vice-versa. In those cases it seems clear that the indexer must have second-guessed what was on the original record. Always look at the record image when you are given the opportunity to do so.