The predication of (a) is concerned with the possibility of achieving a goal, more specifically, if a person is situated at the farmer’s market, he can achieve the goal denoted by the predication. Possibility is a state, rather than an action. Therefore, the adverbial of position 在农贸市场上‘zài nóngmào shìchǎng shàng’ (at the farmer’s market) does not denote the specific position where the action of ‘buying’ takes place, rather, it signals the place where the subject referent is present. Hence, the adverbial phrase is more mobile and can occur in the initial position as the sentential adverbial. This explains the contrast between the ungrammaticality and the possibility of (b).
[1] Loar, J. K. (2011). Chinese syntactic grammar: functional and conceptual principles. New York: Peter Lang.