Hey, now that's got me scratching my head a bit!
To be honest, I'm not sure what you're doing there. Txid and npub are fundamentally different things - one's for transactions and the other's for public keys.
I reckon the sites you mentioned might be using some kind of custom conversion method, but it wouldn't change the fact that a txid and an npub serve totally different purposes in their respective systems.
So while these conversions might be technically possible with certain tools or methods, they don't really make sense in terms of how Bitcoin or Nostr work on a fundamental level. It's like trying to turn an apple into an orange - sure they're both fruit, but they've got very distinct characteristics!