Hi @Davit Grigoryan,
I have done a repro as you said in the comments and was able to associate the Public IP to the Application Gateway.
Like you mentioned, I'm using the Basic SKU and linking it to the VM.
After disassociating the IP and upgrading to the standard SKU.
I successfully associate the IP to application gateway.
Note: Could you please verify that the Public IP and Application Gateway are in the same region? If not, we can't associate the public IP to the Application Gateway.
I hope this helps.
Kindly let us know if the above helps or you need further assistance on this issue.