Cuneiform scripts were frequently coppied by scribes, so the theorem could be even older
The recent “Fall of Civilizations” podcast talks a lot about the history of the pyramids. They may still have known a lot about geometery, but the slopes and angles involved in the pyramid building seem to have been trial and error as much as anything
The pyraamids are way more complex and accurate as been build only by trial and error. It’s architects knew exactly what they were doing and also geometric theorema way more complex as the one of “Phytagoras”, as shown also in other ancient buildings, which are still difficult to reproduce by modern architects.