Rc switch transmit with lambda, how?

Documentation is much better for yaml…

I think you need length there:
void transmit(RemoteTransmitData *dst, uint64_t code, uint8_t len) const;

And protocol:

const RCSwitchBase RC_SWITCH_PROTOCOLS[9] = {RCSwitchBase(0, 0, 0, 0, 0, 0, false)

Try something like this:

 - lambda: |-
          auto call = id(my_tx).transmit();
          uint64_t code = 6288992;  // dec 010111111111011000100000
          esphome::remote_base::RC_SWITCH_PROTOCOLS[4].transmit(call.get_data(), code, 24);
          call.set_send_times(10);
          call.set_send_wait(10000); 
          call.perform();