profile2_load_by_user Trying to get property of non-object
You are assuming there is a profile for all users and your admin user seems to not have one. Add a check if there is a profile for the current logged in user:

function odbornik_fields_form_profile2_edit_main_form_alter(&amp;$form, &amp;$form_state){
global $user;
$profile = profile2_load_by_user($user-&gt;uid, 'main');
if($profile) {
  $checkbox = $profile-&gt;field_testcheckbox['und'][0]['value'];
    if ($checkbox == 0) {  
       $form['profile_main']['field_info'][LANGUAGE_NONE][0]['#type'] = 'hidden'; 
     }
  }
}