This study demonstrates that the prediction error minimization (PEM) mechanism can account for the emergence of reciprocal interaction between two cognitive agents. During interactive processes, alternation of forming and deforming interactions may be triggered by various internal and external causes. We focus in particular on external causes derived from a dynamic and uncertain environment. Two small humanoid robots controlled by an identical dynamic neural network model using the PEM mechanism were trained to achieve a set of coherent ball-playing interactions between them. The two robots predict each other in a top-down way while they try to minimize the prediction errors derived from the unstable ball dynamics or the external cause in a bottom-up way by using the PEM mechanism. The experimental results showed that switching among the set of trained interactive ball plays between the two robots appears spontaneously. The analysis clarified how each complementary behavior can be generated via mutual adaptation between the two robots by undertaking top-down and bottom-up interaction in each individual dynamic neural network model by using the PEM mechanism.