That stings, and it's a common, frustrating spot to be in. Know that getting through the digital assessment stage at both firms means your profile was already competitive—you cleared the automated filters and the preliminary human screen, which is no small feat.
The formal cooling-off period before you are allowed to submit a new application is usually 12 months, and in some European offices, it can be up to 18 months. However, the clock is less important than the content. Simply waiting 12 months and submitting an identical resume is highly unlikely to yield a different result. Recruiters have visibility into your previous application status, and your profile needs to reflect a demonstrable change since the last submission.
Your focus now should not be on calendar counting but on closing the perceived gap. You need to create a significant step-change in your professional story before reapplying. This might mean achieving a rapid promotion, moving into a role with P&L or direct managerial responsibility, or using the time to get into a top-tier MBA program. When you reapply, your new application needs to explain why the outcome should be different this time.
All the best with your pivot.