While my major panic attacks have mostly subsided in the last few years, I recall that some of the minor fits of anxiety more than a year ago occurred during the sudden onset of sickness (e.g., influenza, etc).
Freud, in his “On Narcissism” (c. 1914) proposed that during moments of sickness libidinal investments turn in toward the ego and away from objects. Thus, the ideal ego is diminished, in a sense, and the libido accumulates within the home of the ego.
The ideal ego offers a home when the ego has none. Panic flares up for lack of those imaginary points which constitute the four walls.