Not to mention that it contradicts Optimus' behaviour from the first movie, which had the same script writers and director, so there's no excuse.