Is tagging the hash of a password along with ciphertext secure? Suppose I have a password, in which I use Argon2ID with 1GB memory to derive an encryption key. Then, I encrypt my data using XChaCha20 using that encryption key. The problem with ChaCha is that any encryption key &quot;works&quot;. If you use the wrong password to decrypt, you won't get an empty output or error like AES, but instead, you just get corrupted/useless data. I want to be able to validate the password so that I know whether it is correct before decrypting. If I take the SHA3_512 of the Argon2ID-ed password and include it with the ciphertext, is the ciphertext now vulnerable to attacks? I'm using a CSPRNG to generate Argon2ID's salt and ChaCha's nonce, which would put off rainbow tables. Is this scheme secure? Here's a visual example:
plaintext = &quot;sfsdfasdfadfasdfasdfasdfadf&quot;
password = &quot;some_very_strong_password_blah&quot;
salt = csprng(16)
nonce = csprng(24)
key = argon2id(password,salt,t=32,m=1GB,p=4)
ciphertext = XChaCha20.encrypt(plaintext,password,nonce=nonce)
check = sha3_512(key)
ciphertext += check
// Done. To check the password,
// I would derive the key using Argon2ID
// again and compare it with 'check'

Would this be secure? I know about this question, but that scenario is without a KDF and doesn't include any entropy. Thanks.
Update: AES does not give an empty output if the wrong key is used. The crypto library I use does.
You don't get empty output in AES, too. AES is a permutation and will always return a plaintext, correct or not depending on the key.

If I take the SHA3_512 of the Argon2ID-ed password and include it with the ciphertext, is the ciphertext now vulnerable to attacks?

One needs to find a pre-image to the key, and normally the cost of this is around $2^{512}$ for SHA3-512, however, if you are using xChaCha20 then the cost is around $2^{256}$ since the input is the 256-bit key. In any case, it is secure to be bruteforced.
You can also, encrypt the all-zero message block or any random message block you chose to validate the key.
Note that the Veracrypt uses Decryption is considered successful if the first 4 bytes of the decrypted data contain the ASCII string “VERA”

Is this scheme secure?

First of all, your password's strength is important. You should either use dicewire to have strong passwords or use a password manager to generate one, and those still require a master strong password from you.
The missing part is the integrity of the data, you can use Poly1305 together with the xChaCha20 to have the confidentiality, integrity, and authentication, too.
Another issue can be the update of the encrypted data. If you use the same $(Key, nonce)$ pair for the update, the updated parts of the file are vulnerable to crib-dragging and that part may fail the confidentiality. To mitigate this, you need either use a new $nonce$ and encrypt all of the message or use a new key, too.
A side note; you can use this strong password to derive multiple keys directly
with Argon2id or use HKDF's expand part since the derived key from Argon2id is already is a Pseudo-Random Key.