Magical Weapons tend to be better than this, but beware stacking
First of all, this is a very powerful feature. By my calculations, titanium weapons (let's just call it that for ease of reading) will increase the expected damage of a martial character's Attack Action by about 25% to 35% in common encounter scenarios (math available below). That's a hefty boost to damage, which could make a martial character considerably unbalanced compared to spellcasting classes.
There are potential workarounds: you could make this weapon require a bonus action to use the bonus attack, could make them quite rare or expensive, or could make these weapons impossible to enchant (which I go into below). But overall, I'd be wary of implementing this feature for one main reason:
Beware of 11th level abilities
As SeriousBri pointed out, your proposed titanium weapon feature is a class feature of Gloom Stalker Rangers at level 11.
Stalker's Flurry... Once on each of your turns when you miss with a weapon attack, you can make another weapon attack as part of the same action (XGtE, p. 42)
This should be a serious warning that this feature could be dangerous to combine with other standard features of characters. Keep in mind that 11th level is special, since it is impossible (under the rules as written) to have two 11th level features of two classes in one character. You could make a Rogue 10/Fighter 10 at 20th level, but there's no way to have 11 or more levels in two classes at once. As such, 11th level class features (and features gained at levels higher than 11) are features that the game designers knew could not be combined: they didn't have to worry about dangerous synergies of (for example), a Hunter Ranger's Whirlwind Attack being combined with a Paladin's Improved Divine Smite. So 11th level is a safe place for the designers to start adding features which are potentially unbalancing, when combined with other 11+ level features of different classes.
This isn't proof that titanium weapons would be unbalancing: and in fact, they might not. It depends on the average AC that your enemies have, and how rare these weapons are, and a bunch of other factors. But it's a rule I've found to be generally useful: if a feature is something a certain class gets at 11th level or higher, be wary of adding it to other characters in your game.
How does it compare with magical weapons?
The short answer is that in most situations, magical weapons which give bonuses to attack and damage are better than titanium weapons (as long as that bonus is +2 or better). For example, assuming that they did an average of 12 damage per successful attack with a normal weapon, a fighter could expect around a 40% increase in average damage (assuming they had a 50% chance to hit normally). More importantly, magic weapons circumvent resistance or immunity to nonmagical attacks, which many powerful enemies have.
The danger I see is that it is possible to make a titanium weapons magical! Forge domain clerics could use their Blessings of the Forge on them (XGtE, p. 19), Kensai Monks could use their One With The Blade or Sharpen The Blade features (XGtE, p. 34-35) on them, and the Magic Weapon spell could be cast upon them. If you allowed it, spellcasters could even craft a magical version of titanium weapons. It is when these features combine that I start to worry about the potential of this type of weapon. None of these options are resource free: but they all become considerably more powerful than before with the introduction of titanium.
The issue is that spellcasters can also benefit from magical items which improve their accuracy or increase the likelihood of their spells' success (but raising their attack rolls or spell save DCs), but don't have access to items which boost their spells in the way these titanium weapons boost attacks (for example, letting them force a reroll for a creature that succeeded on a saving throw). This extra level of damage boosting could skew things in favor of martial characters in unforseen ways.
Make it magical/enchantment proof?
The easiest workaround I can think of is to make these weapons interact oddly with magic: perhaps to ensure that they cannot become magically enhanced (cannot be given bonuses to hit or do damage via magic), although they can have their attacks be considered magical for the purposes of overcoming resistance or immunity to nonmagical attacks. This could bring them more in line with +1 or +2 weapons, and keep things relatively stable in your game.
The Mathematics
Let's look a it mathematically
- Let \$p\$ = probability any given attack will hit
- Let \$n\$ = the number of attacks you would have "normally" in a turn (without a titanium weapon)
- Let \$a\$ = the average damage of a single successful attack
- Let \$\mathbb{E}[\mathbf{normal}]\$ = the normal expected damage of your character without this special weapon = \$p\cdot n\cdot a\$.
Essentially, the feature increases the "expected damage" by \$p\cdot a\$ assuming you miss at least once.
If my math is correct, that means that the "expected damage" of a martial character in a round with this special weapon will be
$$\binom{n}{0}p^n(1-p)^0(n\cdot a)+\binom{n}{1}p^{n-1}(1-p)^1((n-1)a+pa)+\binom{n}{2}p^{n-2}(1-p)^2((n-2)\cdot a+pa) + \ldots + \binom{n}{n}p^0(1-p)^n(0\cdot a+pa)$$
This long and busy equation can be simplified considerably. It's really similar to the equation using the Binomial Distribution to find for the expected damage of \$n\$ attacks, with an additional "\$p\cdot a\$" added into most of the coefficient terms (all but the very first one). Using the Binomial Theorem, We can simplify this down to:
$$= \mathbb{E}[\mathbf{normal}] + \left(pa\cdot (1+(1-p))^n - \binom{n}{0}p^n(1-p)^0(p\cdot a)\right)$$
$$= \mathbb{E}[\mathbf{normal}] + \left(pa (1)^n - p^n(p\cdot a)\right)$$
$$= \mathbb{E}[\mathbf{normal}] + a\left(p - p^{n+1}\right)$$
$$= p\cdot n\cdot a + a\left(p - p^{n+1}\right)$$
$$= a\left(p(n+1) - p^{n+1}\right)$$
So that is the "expected" (average) damage your character will do with a titanium weapon. Compare that to apn, the average damage your character will do with a standard weapon.
To see what percent this will increase our damage, we can divide that whole equation by apn (the average damage of a turn of attacking with a steel weapon), and subtract 1.
$$\textrm{average damage percent increase} = \frac{p(n+1) - p^{n+1}}{pn}-1$$
$$ = \frac{p - p^{n+1}}{pn}$$
$$ = \frac{1 - p^{n}}{n}$$
Naturally, what that number will be depends on \$n\$ and \$p\$. But let's consider some common outcomes:
It's not unusual to have around a 40% to 60% chance to hit an enemy. Let's say \$p\$=.5=50% chance (pretty common for a challenging enemy, regardless of your level). If you're doing 2 attacks per round normally (without a titanium weapon), this equates to a 37.5% increase in average expected damage. If you are doing 3 attacks per turn (without a titanium weapon), titanium would increase your average damage by 29.166...%
Note that this feature actually becomes less powerful the more likely you are to hit. When p is 95%, your expected damage only goes up by around 5%. But against challenging or dangerous enemies, titanium would seriously increase the combat effectiveness of standard martial characters.