I think I found a bug in the gc subsystem. To produce type:
(defun tst () (let ((a '()) (b (gc))) (print (append (a '(1 2 3))))))
Space: 4 Bytes, Time: 2620 µS
Error: 'a' undefined
Remove the (gc) call and it works. I think that (gc) removes the local variable a because at this time it is not referenced.