The value was written as typed, bash expanded it when the read-back sourced the file, and the guard rolled the whole write back with nothing on screen but "save failed" — which is also what an empty value, a trailing space, and a stale API-key check had been doing.