Standards are a fine thing but mostly not sufficient for smart cards. You need a manual of your specific card, describing which parts of the standards it supports. For key generation it is a good idea to have a look into ISO 7816, part 8 (in addition to the card manual). There are command variants returning the public key and others leaving it silently in the card for later retrieval. For your error: It is possible, that your card is in a life cycle phase, where key generation is no longer available, but also the even instruction code 46 is worth a try.
The command for encrypting is Perform Security Operation also described in 7816-8. Note, that using an asymmetric key for encryption is unusual for substantial amount of plaintext. Typically the text is encrypted using a symmetric cipher and just the symmetric key transmitted using asymmetric encryption for performance reasons.