Nine is three times three, and much of its symbolic weight comes from being the intensification of a number that already carried weight.
The Bahai faith is the clearest modern case of a religion committed to the figure. Its Houses of Worship are required to be nine-sided, with a central dome and nine entrances, and only a handful exist worldwide, at Wilmette, Sydney, Kampala, Panama City, Frankfurt, New Delhi, Apia and Santiago. Every one of them is a nonagon in plan. The reason is numerical: in the abjad system of letter values the word Baha sums to nine, and nine is the highest single digit, read as completeness and unity. The nine-pointed star is used as an emblem for the same reason, though Bahai sources are careful to say that it is a convention rather than a revealed symbol.
Egyptian theology grouped the Ennead of Heliopolis, nine gods running from Atum through to Osiris, Isis, Set and Nephthys; the Egyptian term simply means the nine. Norse cosmology counts nine worlds joined by Yggdrasil, and Odin hangs on the tree for nine nights. Chinese tradition treats nine as the greatest yang number, hence nine dragons, the nine rows of nine door studs on imperial gates, and ninefold divisions of imperial ritual space. Indian astrology counts the Navagraha, nine planetary influences. Dante's Inferno has nine circles and his Paradiso nine heavens.
Whether any of these traditions was aware that the nine-sided figure resists exact construction is doubtful, and there is no evidence that any of them was. The nonagon's mathematical stubbornness and its symbolic reputation for completion are independent facts that happen to sit side by side.