You need to use the correct equality checking method by using the :test keyword in substitute.
The signature for substitute
is
(substitute newitem olditem sequence &key from-end test test-not start end count key)
Substitute
is using eql
by default, but that won't work in this scenario
(eql "A" "A") ;; nil
(equal "A" "A") ;; t
This will yield the correct results
(defparameter *mytree* nil)
(push "A" *mytree*)
(substitute 8 "A" *mytree* :test 'equal) ;; note the test, returns (8)