Rambam Hiddush Hachodesh 1:6 speaks about Bais Din calculating when the new chodesh should start at deliberately not sitting or making sure to reject witnesses if they came "too early".
That is, if the Sanhedrin calculated that it should be a thirty day month, they would make sure that witnesses would not be able to testify and make it a 29 day month.
6 The [High] Court would make calculations in a manner resembling 11 the
calculations of the astronomers, who know the location of the stars
and their paths [in their orbits]. They would perform careful research
to determine whether or not they would be able to sight the moon at
the appropriate time - i.e., the thirtieth night.
If [the judges] determined that it was possible to sight [the moon],
they would sit waiting for witnesses [to come and testify] throughout
the entire thirtieth day. If witnesses came, and [the court] examined
their testimony according to law, and verified the truth [of their
statements], the court would sanctify [the new month]. If [the moon]
was not sighted, and witnesses did not come,12 they would complete the
thirtieth day, thus making the month full.
If, according to their calculations, [the judges] knew that it was
impossible for the moon to be sighted, they would not sit [in session]
on the thirtieth day, nor would they await [the arrival] of witnesses.
If witnesses came, they would know that they are false witnesses, or
that clouds appeared to them in a form resembling the moon, but it was
not the real moon.
I seem to recall that there do appear to be references in the gemara that appear to imply that before the fixed calendar was set up there could have been occasions in which the chagim occurred on days which the fixed calendar avoids. Unfortunately, I do not have those references available now. However, this would affect only the chagim within Tishrei when the month was declared by witnesses (such as Yom Kippur and Shmini Atzeres).
Thanks to @DonielF for pointing out that the gemara in Rosh Hashana 30b states that since the time of Ezra, Elul never was more than 29 days.
Rambam Chapter 7 Halacha 1 says that Bais Din would carefully set things up so that Rosh Hashana would not fall on Sunday, Wednesday or Friday. The language used would seem to imply that Bais Din would do this even when they declared it according to witnesses, but he does not say it explicitly.
1 [Rosh Chodesh is generally instituted on the day of the conjunction.
Nevertheless,] Rosh Chodesh Tishrei 1 should never be established on a
Sunday, a Wednesday, or a Friday - in symbols, אד"ו - although,
according to these calculations, [the conjunction for the month will
occur on these days]. Instead, when the conjunction for the month of
Tishrei occurs on any of these three days, Rosh Chodesh should be
established on the following day. 2
What is implied? When the conjunction occurs on Sunday, Rosh Chodesh
Tishrei should be established on Monday. When the conjunction occurs
on Wednesday, Rosh Chodesh Tishrei should be established on Thursday.
When the conjunction occurs on Friday, Rosh Chodesh Tishrei should be
established on the Sabbath. 3