Do I understand correctly that 'a day before' and 'the day before', essentially, mean the same thing? The first answers the question "how many days earlier?", the second one "when?", but at the end of the day both mean "yesterday" if the reference point is "today", right?
Basically, I agree. "A day before" refers to a time span, and "the day before" refers to a location in time, and usually that's almost the same thing: yesterday.
There's one sort of case where there is a difference: Suppose something notable happens at 11 PM on Thursday. At 1 AM on Friday, something else notable happens. You could say the first event "happened the day before", but it would be stretching the meaning to say "it happened a day before", since it was only two hours before.