Your “i” is an automatic variable as it is declared internally by the for. Movie it outside for it to work well.
You don’t need a force, just use assignment.
program test ;
bit [0:11] a;
int i;
initial begin
for (i=0 ; i <12 ;i++) begin
a[i] = ~a[i];
$display("element %h is = %h", i, a[i]);
end
end
endprogram