Generating HMAC(SHA256) keys using WebCrypto deriveKey() API
NIST SP 800-107, section 5.3.4 which reads


Let C denote the bit length of the internal hash value that is
denoted H in FIPS 180-4. (This H is often called the “chaining value”
in descriptions of Merkle–Damgård-style hash functions.) Note that C
is not (necessarily) equal to L, the bit length of the hash function’s
output (see, for example, SHA-384 or SHA-512/t for any t &lt; 512, for
which L &lt; 512 = C). In all currently approved hash functions, L ≤ C
(with L = C for SHA-1, SHA- 256, and SHA-512).
The effective security strength of the HMAC key is the minimum of the
security strength of K and the value of 2C. That is, security strength
= min(security strength of K, 2C).


It looks like the API aims to produce HMACS with security strength of 512-bits according to the NIST document, though it also appears that the API comments do not reflect this. I would assume that the intent is to follow NIST and the documentation is at fault.

Following the NIST publication, a uniform random 512-bit key would be required to make best use of the full security offered by the SHA-256 algorithm.