Difference between MAC(key, msg) and SHA(key || msg) I know that SHA(key || msg) is vulnerable to string concatenation attack. However, what if we specified key bit-length and msg bit-length? For example, key bit-length is 256 bit and msg bit-length is 256 bit. If msg or key bit-length is longer than 256 then we simply don't do anything. In this situation, will there be any differences between SHA(key || msg) and MAC(key, msg)??
With the capacity of SHA-3[1] against length extension, It doesn't need HMAC where the key is used twice to build a secure MAC. Instead one can design with prepending the message with the key. Actually, NIST already standardized this into The KECCAK Message Authentication Code KMAC.

With the fixed key and message size, your scheme can be considered as keyed MAC. There is one drawback in your case, the message length prohibits MAC arbitrary messages.

Also, your scheme has a collision where $\operatorname{SHA}(key_1\mathbin\|message_1)=(key_2\mathbin\| message_2)$[2] i.e. the key is used as the message and message as the key ($key_2 = message_1$ and $key_1 = message_2$).

Stick to standards. With KMAC you can MAC arbitrary lengths and have desired output lengths with the help of the cSHAKE128 (XOF - Extendable Output Functions) and have domain separation and even you request different output sizes for the same input, the output will be different.



[1] One can use Blake2 and Skein, too. Those are also resist to length extension attacks

[2] Here we assume that SHA is not SHA-1 or SHA-0. Also note that the SHA-512/256, SHA-512/224, SHA-384 have resistance to length extension attacks. Those are designedNIST  after SHA3