This contradiction may be answered in the following two ways -
1. The Pandavas belong to the Dvapara Yuga, and it is well known that Dharma experiences a decline with each passing Yuga. So, Dvapara Yuga is not an exception, and thus, such acts are counterintuitive to the Varṇāśrama-dharma.
This is how the Mahabharata itself defines such a change
Chapter 189, Markandeya-Samasya Parva, Vana Parva
Rishi Markandeya said -
"...O bull of the Bharata race, in the Krita age, everything was free
from deceit and guile and avarice and covetousness; and morality like
a bull was among men, with all the four legs complete. In the Treta
age sin took away one of these legs and morality had three legs. In
the Dwapara, sin and morality are mixed half and half; and accordingly
morality is said to have two legs only. In the dark age (of Kali), O
thou best of the Bharata race, morality mixed with three parts of sin
liveth by the side of men..."
So, by far, there is no contradiction since Dharma is on the decline, therefore, that will reflect in the Karmas of major people including the Pandavas and other Brahmins. Thus the Brahminas eating cooked food by others is a transgression and a sign of depreciating Dharma over the Yugas.
But, I think, we have a better explanation for these contradictions in the Āpastamba Dharmasūtras.
2. The Brahmins and the Pandavas on account of their exalted status didn't commit any transgression of the Varṇāśrama-dharma.
Well, first of all, the Āpastamba Dharmasūtra doesn't forbid Brahmins from eating food from Kshatriyas and Women, and even Shudras, in case of emergency -
Praśna I, Paṭala 6, Khaṇḍa 19
सर्व वर्णानां स्वधर्मे वर्तमानानां भोक्तव्यं शूद्र वर्जम् इत्येके ॥ १३ ॥
तस्याऽपि धर्मापनतस्य ॥ १४ ॥
- According to some (food offered by people) of any caste, who follow the laws prescribed for them, except that of Śūdras, maybe
- (In times of distress) even the food of a Śūdra, who lives under one's protection for the sake of spiritual merit, (maybe eaten).
So basis this, we can say with conviction that there was no transgression.
However, if by some chance someone tends to not agree with the above reasoning also, then the Āpastamba Dharmasūtras give us more on these issues of "apparent contradictions".
No one in the Mahabharata committed a transgression because all of them were highly exalted people, as says -
Praśna II, Paṭala 6, Khaṇḍa 13
दृष्टो धर्मव्यतिक्रमस्साहसं च पूर्वेषाम् ॥ ७ ॥
प्रत्यवायो न विद्यते ॥ ८ ॥
- Transgression of the law and violence are found amongst the ancient (sages).
- They committed no sin on account of the greatness of their luster.
Same reasonings maybe applied to the Pandavas, and the Brahmins.
This is because, I think, we must take into account the fact that Pandavas, including Draupadi, were no ordinary humans. they had divine origins. And so did all those sages, rishis, and Brahmins, and almost every person, mentioned in the Mahabharata had a divine origin. On account of this, 'eating food cooked by others', which does sound like a transgression of the Varṇāśrama-dharma, is not counted as a transgression.
Although, this does not mean, that an average person citing the example of these apparent transgressions goes on to break the codes of Dharma. These are exceptional exceptions, and not to be used as examples to justify one's own transgressions of the Dharma. One mustn't follow the past misgivings of great people.
As says the Āpastamba Dharmasūtra -
Praśna II, Paṭala 6, Khaṇḍa 13
तदन्वीक्ष्य प्रयुञानस्सीदत्यवरः ॥ ९ ॥
- A man of later times who seeing their (deeds) follows them, falls.
To Conclude -
The distinction between Piety and sin, is very subtle, depends upon particular circumstances, and is at times difficult to distinguish, as discussed in the Śrīmad-Bhāgavatam 11.21.16. The case of Pandavas and Brahmins is such.
However, on account of their divine origins and highly exalted status as individuals, the Pandavas, and the Brahmins, committed no dharmika-transgressions, as per the Āpastamba Dharmasūtras.