On CiviContribute forms within WP, the behavior of predefined amounts and an "Other Amount" input box is broken
I have experienced this behavior in two different situations. In one situation, the Contribution was using a manually created price set that mimicked the behavior of the contribution page with "Allow other amounts" checked. The javascript code is not added for these price sets since CiviCRM can't really tell how they are supposed to work. Switching the contribution page to use the amount options provided by the page itself instead of a price set should solve that problem.

However, in another case, the onclick event was not added because the price set value field's name was "Contribution_Amount" instead of "other_amount". I don't know why the price set value field's name was not created properly.

The code in question is in CRM/Price/BAO/PriceField.php:

if (!empty($qf-&gt;_quickConfig) &amp;&amp; !empty($qf-&gt;_contributionAmount) &amp;&amp; strtolower($fieldOptions[$optionKey]['name']) == 'other_amount') {
  $label .= '  ' . $currencySymbol;
  $qf-&gt;assign('priceset', $elementName);
  $extra = ['onclick' =&gt; 'useAmountOther();'];
}


I figured out which price field value record was the one being used and manually updated it with:

UPDATE civicrm_price_field_value SET name = 'other_amount' WHERE id = 934;


This isn't a great answer to your question - more of a work-around. Figuring out why the price field value record was added with the name set to "Contribution_Amount" would be better.