In reply to mirkic:
You need to keep track of the movement of object handles, versus the data you are assigning inside those objects.
In the top level, you construct two objects, placing their handles in px_in and px_out. Yet px_out is connected to the output of the DUT, which makes a continuous assignment to it. It’s illegal to have both procedural and continuous assignments to the same variable. Inside the DUT, you copy the handle, not the object from px_in to px_out. Now you are left with only one object.
I think what you want is to put the construction of objects inside the always block.
always @(posedge clock) begin
px_in = new();
if (!px_in.randomize()) $error("randomization failed");
end