From my understanding, Israel pretty much did exactly this; however, I remember listening to a British military expert on Deutsche Welle explaining that when a nation reverse engineers the F-35, it locks them out of a lot of intelligence sharing from the US that keeps the F-35 military hardware functioning versus their opponents (Russia, Iran, China, etc). Keep in mind that as a nation develops new military capabilities, its opponents will react to this and switch up their own hardware/tactics so these updates are incredibly important to keep the fighter jet effective over time. Not as much of a problem for Israel since they have well established and funded intelligence agencies and a local military industry that can do this themselves. Their main opponents are also not as militarily capable as Europe's (Russia) so that probably plays a role as well.