might be a UNC, since your original thread is quite clearly coarser.
BSW is almost exactly the same as UNC (except in 1/2"), but not quite, so is not a precision fit.
The "F" in UNF stands for "fine" (introduced for steel parts) and UNC is Coarse (intended for iron parts, like BSW) but also used into alloy castings.
So 1/4" Whit or UNC will have a coarser thread, if that's what you need.
knowing what device it fits, and what country it is made in, and when, would have given good leads.
UNF and UNC if American, since about 1949, and still being used in a few primitive countries that resist SI units.
Whitworth was introduced in UK in 1841
Now mostly superceded by Metric in UK
I think I can see about 5 threads on your 1/4" long old screw, so it is probably 20tpi, or maybe 24tpi if one has been chamfered off.
1/4" BSW has 20tpi, so try that (or UNC, if it was made in USA since 1949, or in a country trading with the American market).
There are 24tpi on 7⁄32" BSW which I think is probably not the one.
There are some very strange anomalies, for example old Morris cars used metric threads but the bolts had imperial heads, since the engines were made by Hotchkiss but the Morris factory had Whitworth spanners.