basically everything Benjamin Franklin did was trial and error because no-one understood what electricity was in the slightest
almost everything Edison did was trial and error too, he had his lab try thousands of materials for his long lasting lightbulb filament
even the most advanced "AI" today is just machine-learning going through everything already known trying to piece together previously discovered facts, admittedly at levels and detail impossible by human hands
but that means there are limits and it's not really "AI"