The tag strings match - great!
The question is the derivation method. Your diagram shows BIP32. The NIP draft uses BIP340 tagged hashes: scan_privkey = int(tagged_hash(“nostr-sp/scan”, sk)) mod n. Same tag strings, different operation, different output keys.
Which does your code actually use? ...